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

How do I make Cancollide false with a player saying a certain word in chat?

I want to make it so when anyone in the server says a certain word, the parts cancollide will equal to false allowing the player to pass through, and then when the wait timer has finished cancollide will then be equalled to true once again. Ex. I would say the word "sonic" and then the parts cancollide would equal to false. https://gyazo.com/ec750b27094add1584ed934d7d0deba4

5 comments

0

According to that image, you haven't learned the basics for coding yet

0

is this a joke

0

look a the unlined part, it should be == not =

0

Stop being mean, back7666. That is a guy that is about to learn Lua. This is not a joke, and his answer shall be answered.

0

Can collide is not a valid thing in players. Read this: https://developer.roblox.com/en-us/articles/Player-Player-Collisions

2 answers

Create a server script and put it in ServerScriptService

script code:

local part = workspace.??? -- replace with part you want to be cancollide false
local time = 4 -- change this to time until it goes back to being solid

game:GetService("Players").PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if string.lower(msg) == "replace this" then -- change replace to text u want player to say
if part:IsA("Part") then
part.CanCollide = false
wait(time)
part.CanCollide = true
end
end
end)
end)

didnt test it yet, replace the ??? with the part you want to change cancollide to and replace the text called "replace this" to what you want the player to say to change the part's cancollide.

This dude is a joke lol. There's no way he doesn't look something up for something that needs fixed. This counts as spam as it could be on purpose so he gets a free script :/

2 comments

0

Bro, why is this an answer?

0

^

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