So now I changed the "triggerserverevent" command to "triggerevent" as it is client side. Now I am not getting the error I said above. But I still cannot drive vehicles. (createvehicle is on server side still)
Full code;
local markerParent = createElement("marker-parent")
--[[
markerParent = parent
marker = child
marker = child
marker = child
addEventHandler listening to:
markerParent
marker
marker
marker
]]
function buyFish(satinAlim)
local money = getPlayerMoney(localPlayer)
if (money >= 300) then
triggerEvent("buyFish", resourceRoot)
outputChatBox("You have bought a fish food.")
takePlayerMoney( 300 )
local marker2 = createMarker (1631.6253662109, 576.00537109375, 0.7578125, "cylinder", 1.2, 600, 600, 900, 1000 )
setElementParent(marker2, markerParent)
else
outputChatBox("You do not have enough amount of money.")
end
end
function botGetir(botdeniz)
botarac = createVehicle(473, 1633.3326416016, 563.24768066406, -0.55000001192093) -- server
end
addEventHandler("onClientMarkerHit", markerParent, botGetir)
-- 473, 1633.3326416016, 563.24768066406, -0.55000001192093