TheJamcof Posted June 6, 2014 Share 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! Link to comment
ViRuZGamiing Posted June 6, 2014 Share Posted June 6, 2014 This freezes the time, you took the wrong example addEventHandler( 'onClientRender', getRootElement( ), function( ) setTime( 1, 0 ) end ) Link to comment
cheez3d Posted June 6, 2014 Share Posted June 6, 2014 addCommandHandler("t12",function() setTime(12,0); outputChatBox("Time changed to 12:00!",root); end); Link to comment
MIKI785 Posted June 6, 2014 Share 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. Link to comment
TheJamcof Posted June 6, 2014 Author Share 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 ) Link to comment
MIKI785 Posted June 6, 2014 Share 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. Link to comment
cheez3d Posted June 6, 2014 Share Posted June 6, 2014 Btw. no need for semicolons. Lua isn't the only language I'm using. Link to comment
TheJamcof Posted June 6, 2014 Author Share Posted June 6, 2014 Thx! This is working now. Link to comment
ZeyadGTX Posted October 7, 2014 Share Posted October 7, 2014 addEventHandler( 'onClientRender', getRootElement( ), function( ) setTime( 1, 0 ) end ) 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