So, I wrote a script. It's supposed to check if you're on the approved spawner list, and if you are, it spawns in a gun. However, it does not work.
local isSpawner = {["gitrog"] = true, ["M8sOfTarkir"] = true, ["PastoBXL"] = true}
function onChatted(message, player)
if message == "/sp tec" and isSpawner[player.Name] then
game.ServerStorage.SpawnerStorage["Tec-9"]:Clone().Parent = game.Players.player.Backpack
end
end
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message) onChatted(message, player) end)
end)

5 comments
Errors?
player is not a valid member of Players
Tried game.Players[player.Name].Backpack ?
It's treating player as the name of a child itself looking for a child called "player".
@BobserLuck That worked. Can you write that as an answer, so I can mark it as correct?