marty000123 Posted January 26, 2017 Share Posted January 26, 2017 (edited) Hello function zombieChange() local timehour, timeminute = getTime() if timehour == 12 then outputChatBox( "works", player, 255, 0, 255 ) end end It doesn't work. Help would be appreciated. It basically needs to put out ''works'' when it's 12:00 ingame time. But I think that was already clear Edited January 26, 2017 by marty000123 Link to comment
MIKI785 Posted January 26, 2017 Share Posted January 26, 2017 Well, where is that function being called? Link to comment
idarrr Posted January 26, 2017 Share Posted January 26, 2017 Is that client side or server side code? If client side: function zombieChange() local timehour, timeminute = getTime() if timehour == 12 then outputChatBox( "works", 255, 0, 255 ) -- No need to add player here, as it a client script it will only show the output for the client it self. end end If server side: function zombieChange(player) -- Add player argument here local timehour, timeminute = getTime() if timehour == 12 then outputChatBox( "works", player, 255, 0, 255 ) -- Show the output only for the player who called the function. end end And also if its a server side code, where did you call it? Link to comment
marty000123 Posted January 26, 2017 Author Share Posted January 26, 2017 Both don't work. Link to comment
koragg Posted January 27, 2017 Share Posted January 27, 2017 The only thing I see is that there's no event handler so it doesn't know when to execute the function. I'd advise you to make it client side and put onClientRender as the event handler. Then when the time comes it'll display the chatbox. If it still doesn't work I don't know as your code looks ok. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now