Search the Community
Showing results for tags 'create vehicle'.
-
Hi want to make a system for vehicles like hydra rhino were players can buy it from money by using it only for 2-5min ! I tested many trays the things is server is spawning vehicle but can't enter the vehicle ,take money also working fine but I can't enter the vehicle First try it works for take money and spawning vehicle but cant enter vehicle ! function buy() --<spawn a vehicle >-- local luckyBugger = getLocalPlayer() -- get the local player local x, y, z = getElementPosition ( luckyBugger ) -- retrive the player's position if lol()then lel() veh=createVehicle ( 520, x, y, z + 10 ) outputChatBox ( "You got Hydra", 255, 0, 0) end end addEventHandler("onClientGUIClick",GUIEditor.button[1],buy) local money = getPlayerMoney(luckyBugger) local count = 2000000 function lol() if (money >= count ) then takePlayerMoney(luckyBugger,count) else outputChatBox("You don't have Money") end end function lel() destroyElement(veh) end setTimer(lel,120000,1) Second i tried with only spawn same hydra spawnbut cant enter addEventHandler("onClientGUIClick",GUIEditor.button[1], function () --<spawn a vehicle >-- local luckyBugger = getLocalPlayer() -- get the local player local x, y, z = getElementPosition ( luckyBugger ) -- retrive the player's position createVehicle ( 520, x, y, z + 10 ) outputChatBox ( "You got Hydra", 255, 0, 0) end) I used it in both client and server side same error on both sides