I'm trying to make a script that gives a player an item if they have purchased the gamepass. The game is in Filtering Enabled by the way.
gpid = (4676621)
tools = {"Flashlight"}
GPS = game:GetService("GamePassService")
function respawned(char)
player = game.Players:FindFirstChild(char.Name)
print("Respawned")
if char:FindFirstChild("Head") ~= nil then
print("It's a Player!")
if GPS:PlayerHasPass(player, gpid) then
print("Has GPID")
for i = 1,#tools do
game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.Backpack
end
end
end
end
game.Workspace.ChildAdded:connect(respawned)
I'm a bit of a noob, so please go easy on me!

2 comments
Stop using the “I’m a bit of a noob, so please go easy on me!" It just asks for people to go hard, and you’ve used that for months.
I'm just informing people no need to be rude.. :I