What is the error on this?

Started by VK.Jona83Killer, Jun 21, 2018, 03:26 PM

Previous topic - Next topic

VK.Jona83Killer

else if (!DistanceFromPoint(Cosa.x,Cosa.y,player.Pos.x,player.Pos.y) < 10);
cause this error:
comparison between 'bool' and '10'

how to fix?

NicusorN5

Fixed:
else if (!(DistanceFromPoint(Cosa.x,Cosa.y,player.Pos.x,player.Pos.y) < 10))

VK.Jona83Killer


[KM]Helathien

Just do it like this
local InPlace = DistanceFromPoint(Cosa.x,Cosa.y,player.Pos.x,player.Pos.y) < 10
else if ( !InPlace )

Feel free to PM me for any help.
If I am not available on the forum come to VKs Official Server I am usually there.

kennedyarz

Quote from: [KM]Helathien on Jun 21, 2018, 05:04 PMJust do it like this
local InPlace = DistanceFromPoint(Cosa.x,Cosa.y,player.Pos.x,player.Pos.y) < 10
else if ( !InPlace )

local InPlace = DistanceFromPoint(Cosa.Pos.x, Cosa.Pos.y, player.Pos.x, player.Pos.y) < 10
else if ( !InPlace )

adding Pos to Cosa