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

When phrase said CanCollide is false?

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?

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

1 comment

0

Sure, I'll try that! Thanks!

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