TheJamcof Posted June 6, 2014 Posted June 6, 2014 Hello! This script's idea was, when I type command "t12" then it make time freezed to 12:00, but it won't work. function setTimeAndNotify( 12, 00 ) setTime ( 12, 00 ) local notifyMessage = string.format("Time changed to %12d:%00d!", hour, minute) outputChatBox ( notifyMessage ) end addCommandHandler ("t12") Please help me! Thank you!
ViRuZGamiing Posted June 6, 2014 Posted June 6, 2014 This freezes the time, you took the wrong example addEventHandler( 'onClientRender', getRootElement( ), function( ) setTime( 1, 0 ) end )
cheez3d Posted June 6, 2014 Posted June 6, 2014 addCommandHandler("t12",function() setTime(12,0); outputChatBox("Time changed to 12:00!",root); end);
MIKI785 Posted June 6, 2014 Posted June 6, 2014 addCommandHandler("t12",function() setTime(12,0); outputChatBox("Time changed to 12:00!",root); end); Still wouldn't freeze it though, put setMinuteDuration with some big value in it and it will look frozen. Btw. no need for semicolons.
TheJamcof Posted June 6, 2014 Author Posted June 6, 2014 addCommandHandler("t12",function() setTime(12,0); outputChatBox("Time changed to 12:00!",root); end); Still wouldn't freeze it though, put setMinuteDuration with some big value in it and it will look frozen. Btw. no need for semicolons. Can someone show me how to add setMinuteDuration to this script? (Because I don't have skills )
MIKI785 Posted June 6, 2014 Posted June 6, 2014 addCommandHandler("t12",function() setTime(12, 0) setMinuteDuration(3600000) outputChatBox("Time changed to 12:00!") end) Here one minute will last one hour.
cheez3d Posted June 6, 2014 Posted June 6, 2014 Btw. no need for semicolons. Lua isn't the only language I'm using.
ZeyadGTX Posted October 7, 2014 Posted October 7, 2014 addEventHandler( 'onClientRender', getRootElement( ), function( ) setTime( 1, 0 ) end )
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