Jump to content

how to fix


Recommended Posts

Hello

 

 

 

Mta dayz

vehicle_spawns.Lua

 

function checkVehicleInWater ()
    local randomPlayer = getRandomPlayer()
    triggerClientEvent(randomPlayer,"checkVehicleInWaterClient",randomPlayer)
end
setTimer(checkVehicleInWater,1800000,0)

 

Error console:

Bad argument @ ' triggerClientEvent' [Expected string at argument 1, got boolean]

 

Link to post

Make sure that getRandomPlayer is returning a player-element, if the server is empty it will return false.

function checkVehicleInWater ()
	local randomPlayer = getRandomPlayer()
	if randomPlayer then
		triggerClientEvent(randomPlayer,"checkVehicleInWaterClient",randomPlayer)
	end
end
setTimer(checkVehicleInWater,1800000,0)

 

  • Like 1
Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...