My script has an error (W001: Unknown global 'Player'). I'm trying to make a script where you say "open" and it opens a door (takes collisions off a part). It works, but I'm trying to make it only work for a player with a certain rank or higher in a group.
This is the script:
-- SETTINGS -- GroupID = 4546303 Rank = 255 NonRank = 2 -- SCRIPT -- function onChatted(msg, recipient, speaker) local source = string.lower(speaker.Name) msg = string.lower(msg) if (msg == "open") then if Player:GetRankInGroup(GroupID) >= Rank then -- this is the line with the error: W001: Unknown global 'Player' end game.Workspace.Part.CanCollide = false end end function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end) end game.Players.ChildAdded:connect(onPlayerEntered)
Can anyone help me with this?
Player
doesn't exist. I think you meant to put "speaker"