This is the code I use for gamepass tools.
local id = 0000000 --Change this to the gamepass id you want game.Players.PlayerAdded:connect(function(player) if Game:GetService("GamePassService"):PlayerHasPass(player, id) then --Added the Parameters local clone = game.ServerStorage.VoidSword:Clone() -- You need the parenthesis and to determine where it will be parented to clone.Parent = player:WaitForChild("Backpack") --In this game the player's Backpack print(player.Name .. " has the game pass!") else print(player.Name .. " doesn't have the game pass...") end end)
But when the player dies after receiving the tool, it doesn't appear in the player's backpack again. (Credit to yougottols1 for helping me with the script)
Just add a CharacterAdded event to the joining players so that the tool gets added every time they respawn if they have the tool.
local id = 0000000 --Change this to the gamepass id you want game.Players.PlayerAdded:connect(function(player) if game:GetService("GamePassService"):PlayerHasPass(player, id) then player.CharacterAdded:Connect(function() -- added character added event local clone = game.ServerStorage.VoidSword:Clone() clone.Parent = player:WaitForChild("Backpack") end) end end)