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

This simple GamePass script isn't working... Can anybody help? [UNSOLVED]

So there are no output errors, and my problem is that the tool named "Customized" is not being cloned into the player's backpack if they have this gamepass.

The tool "Customized" is located in ServerStorage.

This is in a regular Script inside ServerScriptService.

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		if game:GetService("GamePassService"):PlayerHasPass(player, 187979130) then
			game.ServerStorage.Customize:Clone().Parent = player:WaitForChild("Backpack")
		end
	end)
end)

1 answer

You have 1 simple error in your script. For checking if someone has a certain badge, you have to use the players id. So line 3 should look like this:

if game:GetService("GamePassService"):PlayerHasPass(player.userId, 187979130) then

That's the only error I noticed. If you have any questions or problems, please leave a comment below. Hope I helped :P Update: I'll just provide the whole script for you

game.Players.PlayerAdded:connect(function(player)
        if game:GetService("GamePassService"):PlayerHasPass(player.userId, 187979130) then
            game.ServerStorage.Customize:Clone().Parent = player:WaitForChild("Backpack")
        end
end)

Idk why it wouldn't work. If this doesn't work, then there's probably an error somewhere else...

2 comments

0

Didn't fix it.

0

That's what my script looks like.

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