Need help with IsEntityInWater and IsPedSwimming

Sorry for my bad english

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
        local playerPed = GetPlayerPed(-1)
		if IsEntityInWater(playerPed) and IsPedSwimming(playerPed) then
          TriggerServerEvent('esx_napiecie:tele')
          print("Test")
        end
end

When i’m in water console is not printing anything

forgot to end the loop and the thread.

1 Like