opnaiC Posted June 25, 2016 Share Posted June 25, 2016 client function fbirancherp () triggerServerEvent ( "fbi", getLocalPlayer(), fbirancherp ) end addEventHandler ("onClientDXClick", fbirancher, fbirancherp) server function fbiscript ( target ) local x, y, z = getElementPosition( target ) rancher = createVehicle ( 490, x, y, z+2 ) end addEvent ("fbi", true) addEventHandler ("fbi", getRootElement(), fbiscript) Error: Link to comment
#RooTs Posted June 25, 2016 Share Posted June 25, 2016 try this function fbiscript () local x, y, z = getElementPosition( source ) rancher = createVehicle ( 490, x, y, z+2 ) end addEvent ("fbi", true) addEventHandler ("fbi", getRootElement(), fbiscript) --or function fbiscript (thePlayer) local x, y, z = getElementPosition( thePlayer ) rancher = createVehicle ( 490, x, y, z+2 ) end addEvent ("fbi", true) addEventHandler ("fbi", getRootElement(), fbiscript) Link to comment
Dimos7 Posted June 25, 2016 Share Posted June 25, 2016 --Server Side function fbiscript(thePlayer) local x, y, z = getElementPosition(thePlayer) rancher = createVehicle(490, x, y, z+2) end addEvent("fbi", true) addEventHandler("fbi", root, fbiscript) --Client Side function fbirancherp() triggerServerEvent("fbi", localPlayer) end addEventHandler("onClientDxClick", fbirancher, fbirancherp) Link to comment
opnaiC Posted June 25, 2016 Author Share Posted June 25, 2016 try this function fbiscript () local x, y, z = getElementPosition( source ) rancher = createVehicle ( 490, x, y, z+2 ) end addEvent ("fbi", true) addEventHandler ("fbi", getRootElement(), fbiscript) --or function fbiscript (thePlayer) local x, y, z = getElementPosition( thePlayer ) rancher = createVehicle ( 490, x, y, z+2 ) end addEvent ("fbi", true) addEventHandler ("fbi", getRootElement(), fbiscript) Its working this way but it spawns 4 fbi rancher ... Idk why 4 of them ... function fbiscript () local x, y, z = getElementPosition(source) rancher = createVehicle ( 490, x, y, z + 10 ) end addEvent ("fbi", true) addEventHandler ("fbi", getRootElement(), fbiscript) 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