Reputation: 13
I have a problem with negation in roblox lua. I can't find anywhere how to do that. I've tried to use this code:
script.Parent.DoorRoot.CanCollide != script.Parent.DoorRoot.CanCollide
It didn't worked so I tried with
script.Parent.DoorRoot.CanCollide = !script.Parent.DoorRoot.CanCollide
But it still didn't worked. Can somebody help me with that?
Upvotes: 0
Views: 393
Reputation: 7188
If you're asking for equality use ~=
local foo = 1 ~= 0
If you're trying to negate a value, use the not
keyword
script.Parent.DoorRoot.CanCollide = not script.Parent.DoorRoot.CanCollide
Upvotes: 3