Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.