Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my function for CanCollide & the if, then, else script not working?

Asked by
Arolam 10
8 years ago

local Nuber = 22 local NuberGoal = 21

if Nuber > NuberGoal then script.Parent.properties.CanCollide = false else script.Parent.properties.CanCollide = true end

This is what I am trying to do, does anyone know how to fix it, I've looked everywhere.

1 answer

Log in to vote
0
Answered by 8 years ago

You do not actually need to call .properties, since CanCollide is a property

Try this, it should work:

local Nuber = 22 
local NuberGoal = 21

wait(1)

if Nuber > NuberGoal then 
    script.Parent.CanCollide = false 
else 
    script.Parent.CanCollide = true 
end
Ad

Answer this question