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

CanCollide Script Not Functioning?

local Parties = script.Parent.Parent.Part
local booleen = script.Parent.Value

if booleen.Value == 1 then
script.Parent.CanCollide=false
end

so i have been learning to script and its been going well up to now. What i have already done is made a function that when touched sets the Number value from 0 to 1 but now i made this script so that it reads the vlaue i defined as booleen and then says if its 1 it will make the part defined as parties uncollided but it does not work! Only the number value changes to 1. im sure someone can easily help with this. Tried all the statements even elseif

2 answers

✓ Accepted answer
local Parties = script.Parent.Parent.Part
local booleen = script.Parent.Value

if booleen.Value == 1 then
script.Parent.CanCollide=false
end

the problem with your script is that, script.Parent is the booleen and the Part is script.Parent.Parent.Part

local Parties = script.Parent.Parent.Part
local booleen = script.Parent.Value

if booleen.Value == 1 then
script.Parent.Parent.Part.CanCollide=false
end

or

local Parties = script.Parent.Parent.Part
local booleen = script.Parent.Value

if booleen.Value == 1 then
Parties.CanCollide=false
end

1 comment

0

oh lol thx i did solve it by my self by using a else function if script.Parent.Value == 0 then script.Parent.CanCollide = true else script.Parent.CanCollide = false end

Nvm i solved it by

if script.Parent.Value == 0 then 
script.Parent.CanCollide = true
else 
script.Parent.CanCollide = false	
end

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