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

Script won't work, why?

I'm making a "name that character" script; when you say the right word you'll pass through. But, when I play the game i can just go through all of them help me!!!

local door = script.Parent game.Players.PlayerAdded():connect(function(player) player.Chatted:connect(function(msg) if msg == "msg" then door.CanCollide = false door.Transpareny = 1 wait(3) door.CanCollide = true door.Transparency = 0 end end end

1 comment

1

Code block, plz.

3 answers

local door = script.Parent 
-- you don't need the () after PlayerAdded
game.Players.PlayerAdded:connect(function(player) 
	player.Chatted:connect(function(msg) 
		if msg:lower() == "msg" then -- i used the lower method so it's not case-sensitive
			door.CanCollide = false 
			door.Transpareny = 1 
			wait(3) 
			door.CanCollide = true 
			door.Transparency = 0 
		end 
	end) -- you need closing parentheses on these two ends because your connecting the function to the event anonymously 
end)

Change the if msg =="to the characters name in the picture"

1 comment

0

I do that but wont work

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