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

CanCollide Script Not Functioning?

Asked by
sammiya1 134
8 years ago
1local Parties = script.Parent.Parent.Part
2local booleen = script.Parent.Value
3 
4if booleen.Value == 1 then
5script.Parent.CanCollide=false
6end

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

Log in to vote
1
Answered by 8 years ago
1local Parties = script.Parent.Parent.Part
2local booleen = script.Parent.Value
3 
4if booleen.Value == 1 then
5script.Parent.CanCollide=false
6end

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

1local Parties = script.Parent.Parent.Part
2local booleen = script.Parent.Value
3 
4if booleen.Value == 1 then
5script.Parent.Parent.Part.CanCollide=false
6end

or

1local Parties = script.Parent.Parent.Part
2local booleen = script.Parent.Value
3 
4if booleen.Value == 1 then
5Parties.CanCollide=false
6end
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 sammiya1 134 — 8y
Ad
Log in to vote
0
Answered by
sammiya1 134
8 years ago

Nvm i solved it by

1if script.Parent.Value == 0 then
2script.Parent.CanCollide = true
3else
4script.Parent.CanCollide = false   
5end

Answer this question