The Gamepass IDs are correct, and I've bought my own gamepass, for 50 ROBUX but it doesn't give me the Gamepass tool.
--Nidoxs local DaggerId = 1000438124 local DaggerTool = game.ServerStorage.GamepassTools.Dagger local GreatswordId = 1000442559 local GreatSTool = game.ServerStorage.GamepassTools.Greatsword local GPS = game:GetService("GamePassService") game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Character) if GPS:PlayerHasPass(Player,DaggerId) then local ToolForPlayer = DaggerTool:Clone() ToolForPlayer.Parent = Player:WaitForChild("Backpack") end if GPS:PlayerHasPass(Player, GreatswordId) then local ToolForPlayer = GreatSTool:Clone() ToolForPlayer.Parent = Player:WaitForChild("Backpack") end end) end)
You should tell us the errors when something doesn't work by pressing F9 (opens Developper Console)
I assume it doesn't work because your Dagger and Greatsword aren't loaded fast enough, add a WaitForChild() WaitForChild on Backpack is useless. Backpack will always be loaded very quickly
Instead of cloning the tools in the backpack inside of a CharacterAdded event, you should of just cloned the tools in the StarterGear (which is inside of the player) to make it so it is always present, even when you die
I would recommend cloning the weapons into StarterGear
instead of Backpack
, as F4ULT1NTH3D4T4 said.
local DaggerId = 1000438124 local GreatSId = 1000442559 local DaggerTool = game.ServerStorage.GamepassTools.Dagger:Clone() local GreatSTool = game.ServerStorage.GamepassTools.Greatsword:Clone() game.Players.PlayerAdded:Connect(function(player) if game:GetService("GamePassService"):PlayerHasPass(player, DaggerId) then DaggerTool.Parent = player.StarterGear else print("Player does not have gamepass") end if game:GetService("GamePassService"):PlayerHasPass(player, GreatSId) then GreatSTool.Parent = player.StarterGear else print("Player does not have gamepass") end end)
This has been tested, and it works 100%. If this helped, please accept my answer! Thanks!