I am currently working on making a restricted door where when a certain person says open the door will open. i wrote some script and it hasnt worked but i dont know why can anyone help?
game.Players.PlayerAdded:connect(function(player) if player.Name == "Player" then player.Chatted:connect(function(msg) if msg == "open" then Run() end end) end end)
Assuming
Run
an existing function, it should be working..Run = function() print'ran' end game.Players.PlayerAdded:connect(function(player) if player.Name == "Player" then player.Chatted:connect(function(msg) if msg == "open" then Run() end end) end end)The sample above, for instance, would print "ran" if "Player" chats "open"