boro Posted February 22, 2013 Share Posted February 22, 2013 Hi all i make script for set model 165 and 166 when is resource start but when resource start then i have still model number 165 and model 166 no only still 165 model what is bad ? please help addEventHandler("onResourceStart", resourceRoot, function() setElementModel(source, 165 or 166) end ) Link to comment
PaiN^ Posted February 22, 2013 Share Posted February 22, 2013 addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), setTimer( function(player) if getElementType(player) == "player" then local ID = math.random(165, 166) setElementModel(player, ID) end end, 5000, 0) ) This will change your model every 5 seconds( between 165, 166 only !!) Tell me if you don't want it with timer Link to comment
iPrestege Posted February 22, 2013 Share Posted February 22, 2013 Client Side : addEventHandler("onClientResourceStart",resourceRoot, function () triggerServerEvent("SetData",localPlayer) end) Server Side : addEvent("SetData",true) addEventHandler("SetData",root, function () setElementModel(source,math.random(165,166)) end) Best To Do it Trigger To Check Players ^^ @ Mr.Alm You're Script Won't work . Link to comment
PaiN^ Posted February 22, 2013 Share Posted February 22, 2013 @ Mr.Alm You're Script Won't work . Why ?? Link to comment
iPrestege Posted February 22, 2013 Share Posted February 22, 2013 @ Mr.Alm You're Script Won't work . Why ?? The Timer is Wrong . Link to comment
PaiN^ Posted February 22, 2013 Share Posted February 22, 2013 The Timer is Wrong . In what ? Link to comment
iPrestege Posted February 22, 2013 Share Posted February 22, 2013 The Timer is Wrong . In what ? As i say in the "setTimer" ! Link to comment
PaiN^ Posted February 22, 2013 Share Posted February 22, 2013 The Timer is Wrong . In what ? As i say in the "setTimer" ! I know , I mean what's wrong about it Link to comment
TAPL Posted February 22, 2013 Share Posted February 22, 2013 onResourceStart don't have player parameter, can't you even open the fucking wiki and read? And again can't you even open the fucking wiki and read about addEventHandler? Link to comment
iPrestege Posted February 22, 2013 Share Posted February 22, 2013 onResourceStart don't have player parameter, can't you even open the wiki and read?And again can't you even open the wiki and read about addEventHandler? I Know That Becuase That I Trigger It If Am Right ? 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