janghoro
(janghoro)
October 16, 2020, 11:46am
#1
Hi guys, i have a question about a little script that i dont understand how to do it.
So, i want to make like if the button is touched, then the other part (for example door) cancolide.
Here what i did, but it doesnt work
local function Coolsauce()
game.Workspace.door.CanCollide = true
end
game.Workspace.door2.Touched:Connect(Coolsauce)
Any output errors we can see? The script looks fine. Also you should make sure that door IS NOT can collide.
1 Like
janghoro
(janghoro)
October 16, 2020, 11:47am
#3
There is no errors, i tried everything
Did you set CanCollide to true for door? You should initially make it false first.
janghoro
(janghoro)
October 16, 2020, 11:49am
#5
yea i did, but still nothing has changed
Can you make a video of it? The script looks really nothing wrong.
janghoro
(janghoro)
October 16, 2020, 11:51am
#7
WAITTT IT WORKED, Tysm dude!!! .DDDD
1 Like
Now you can mark my comment as solution.
2 Likes
No no I mean, mark the 4th comment as the solution.
Z_lqify
(Kuzey)
October 16, 2020, 11:53am
#10
You just said coolsauce instead of function() so you can try it.
local function Coolsauce()
game.Workspace.door.CanCollide = true
end
game.Workspace.door2.Touched:Connect(function(Coolsauce))
```
No need to add function(), just:
Connect:(Coolsauce)
avodey
(avocado)
October 16, 2020, 11:59am
#12
actually its :Connect(Coolsauce)
also why is the function called Coolsauce…?
Whoops! Looks like my spelling is acting up. Thanks for telling lol.
janghoro
(janghoro)
October 16, 2020, 12:02pm
#14
lol i didnt knew what to type there, instead my brain said Coolsauce lmao