xTravax Posted March 7, 2015 Share Posted March 7, 2015 hey i have a problem if i create a weapon with createWeapon, it will create it only for me, but won't be synced with other players how to fix this? others can't see my custom weapon Link to comment
xeon17 Posted March 7, 2015 Share Posted March 7, 2015 (edited) You have to use triggerClientEvent to make it visible for everyone. I had the same problem before some time Edited March 7, 2015 by Guest Link to comment
Enargy, Posted March 7, 2015 Share Posted March 7, 2015 You will have to run the serverside function. use triggerClientEvent; E.g: ---SERVER addCommandHandler("createweapon", function (thePlayer, command) local x,y,z = getElementPosition(thePlayer) x = x + 5 triggerClientEvent(thePlayer, "onCreateWeapon", getRootElement(), x, y, z) end ) ---CLIENT addEvent("onCreateWeapon", true) addEventHandler("onCreateWeapon", getRootElement(), function (x, y, z) local weapon = createWeapon("minigun", x, y, z) 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