zW1Z4RD Posted April 30, 2020 Share Posted April 30, 2020 Opa, estou fazendo um script de roubo a veiculo, porem sou iniciante nisso. Gostaria que você me ajudasse a colocar um blip que seguisse o veiculo Esse é o codigo do spawn do carro addEvent("cartheft:getcar", true) addEventHandler("cartheft:getcar", getRootElement(), function() local random = math.random(#getCarList) local cords = getCarList[random] table.remove(getCarList, random) local cars = carList[math.random(#carList)] local vehicle = createVehicle(cars[1], cords[2], cords[3], cords[4], 0, 0, cords[5]) setElementData(vehicle, "cartheft:player", source) setElementData(source, "cartheft:vehicle", vehicle) setElementFrozen(vehicle, true) setVehicleLocked(vehicle, true) setVehicleDamageProof(vehicle, true) triggerClientEvent(source, "cartheft:getcar", source, cars[2], cars[3], cars[4], cords[1], cords[2], cords[3]) getCarCreate[vehicle] = cords end ) Porem eu queria que o blip fosse ativado junto com essa função, pois ela é ativada quando o player hackear o carro E por que quando eu tendo mudar esses ChatBox para ir somente pro player, sempre da um erro: [Expected number at argument 2, got gui-button] function chekButtonNumber() if (guiGetText(gui[9]) == guiGetText(gui[13])) and (guiGetText(gui[10]) == guiGetText(gui[14])) and (guiGetText(gui[11]) == guiGetText(gui[15])) and (guiGetText(gui[12]) == guiGetText(gui[16])) then showCursor(false) triggerServerEvent("cartheft:opencar", localPlayer) guiSetVisible(gui[8], false) outputChatBox("Policias atenção o veiculo acabou de ser roubado", 25, 255, 25) outputChatBox("Você abriu o carro.", 25, 255, 25) end end Link to comment
MRXBBC Posted April 30, 2020 Share Posted April 30, 2020 5 hours ago, zW1Z4RD said: Opa, estou fazendo um script de roubo a veiculo, porem sou iniciante nisso. Gostaria que você me ajudasse a colocar um blip que seguisse o veiculo Esse é o codigo do spawn do carro addEvent("cartheft:getcar", true) addEventHandler("cartheft:getcar", getRootElement(), function() local random = math.random(#getCarList) local cords = getCarList[random] table.remove(getCarList, random) local cars = carList[math.random(#carList)] local vehicle = createVehicle(cars[1], cords[2], cords[3], cords[4], 0, 0, cords[5]) setElementData(vehicle, "cartheft:player", source) setElementData(source, "cartheft:vehicle", vehicle) setElementFrozen(vehicle, true) setVehicleLocked(vehicle, true) setVehicleDamageProof(vehicle, true) triggerClientEvent(source, "cartheft:getcar", source, cars[2], cars[3], cars[4], cords[1], cords[2], cords[3]) getCarCreate[vehicle] = cords end ) Porem eu queria que o blip fosse ativado junto com essa função, pois ela é ativada quando o player hackear o carro E por que quando eu tendo mudar esses ChatBox para ir somente pro player, sempre da um erro: [Expected number at argument 2, got gui-button] function chekButtonNumber() if (guiGetText(gui[9]) == guiGetText(gui[13])) and (guiGetText(gui[10]) == guiGetText(gui[14])) and (guiGetText(gui[11]) == guiGetText(gui[15])) and (guiGetText(gui[12]) == guiGetText(gui[16])) then showCursor(false) triggerServerEvent("cartheft:opencar", localPlayer) guiSetVisible(gui[8], false) outputChatBox("Policias atenção o veiculo acabou de ser roubado", 25, 255, 25) outputChatBox("Você abriu o carro.", 25, 255, 25) end end só criar um blip com a posição cords addEvent("cartheft:getcar", true) addEventHandler("cartheft:getcar", getRootElement(), function() local random = math.random(#getCarList) local cords = getCarList[random] table.remove(getCarList, random) local cars = carList[math.random(#carList)] local vehicle = createVehicle(cars[1], cords[2], cords[3], cords[4], 0, 0, cords[5]) local x,y,z = getElementPosition( vehicle ) local blipcar = createBlip( x, y, z, 51, 0, 0, 0, 255, source ) setElementData(vehicle, "cartheft:player", source) setElementData(source, "cartheft:vehicle", vehicle) setElementFrozen(vehicle, true) setVehicleLocked(vehicle, true) setVehicleDamageProof(vehicle, true) triggerClientEvent(source, "cartheft:getcar", source, cars[2], cars[3], cars[4], cords[1], cords[2], cords[3]) getCarCreate[vehicle] = cords end ) function chekButtonNumber() if (guiGetText(gui[9]) == guiGetText(gui[13])) and (guiGetText(gui[10]) == guiGetText(gui[14])) and (guiGetText(gui[11]) == guiGetText(gui[15])) and (guiGetText(gui[12]) == guiGetText(gui[16])) then showCursor(false) triggerServerEvent("cartheft:opencar", localPlayer) guiSetVisible(gui[8], false) outputChatBox("Policias atenção o veiculo acabou de ser roubado", 25, 255, 25) outputChatBox("Você abriu o carro.", 25, 255, 25) end end tente isso Link to comment
Other Languages Moderators Lord Henry Posted April 30, 2020 Other Languages Moderators Share Posted April 30, 2020 Use createBlipAttachedTo para criar o blip anexado no veículo. Sobre o problema de outputChatBox, ele só pode ser mandado ao localPlayer enquanto estiver no script client-side. Se você quer mandar pra outros jogadores, o outputChatBox precisa estar no script server-side. 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