I have almost zero knowledge of scripting. I want to make a script where when a certain phrase is said in the chat, a parts CanCollide turns to false. Does anybody know how to do that?
✓ ANSWER ACCEPTED
When phrase said CanCollide is false?
1 answer
✓ Accepted answer
Sure! We can make it a command.
Assuming that a part named cmdPart is in the Workspace, you can insert a script with the following into ServerScriptService:
local Part = workspace.cmdPart
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
if string.lower(message) == "/set canCollide" then
if Part.CanCollide == true then
Part.CanCollide = false
else
Part.CanCollide = true
end
end
end)
end)
:D
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Sure, I'll try that! Thanks!