Hello, I have a gamepass tool script from @SOTR654, but whenever the player repawns, the tool gets gone from the player’s backpack.
The script is inside ServerScriptService, and the tool is located in ServerStorage.
Here is the script:
game.Players.PlayerAdded:Connect(function(player)
local success, boughtGamepass = pcall(function()
return game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 19237735)
end)
if success and boughtGamepass then
local winterStick = game:GetService("ServerStorage"):WaitForChild("WinterStick"):Clone()
winterStick.Parent = player.Backpack
end
end)
Is there a solution to fix this problem? Thank you.
local Serv = game:GetService("GamePassService")
local MServ = game:GetService("MarketplaceService")
local vtool = game:GetService("ServerStorage"):WaitForChild("WinterStick"):Clone()
game.Players.PlayerAdded:Connect(function(player)
local success, boughtGamepass = pcall(function()
return game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 19237735)
end)
if success and boughtGamepass then
vtool:Clone().Parent = player.Backpack
end
end)
workspace.ChildAdded:Connect(function(char)
local getpl = game:GetService("Players"):FindFirstChild(char.Name)
if char:FindFirstChild("HumanoidRootPart") ~= nil then
if MServ:UserOwnsGamePassAsync(getpl.UserId, 19237735) then
vtool:Clone().Parent = getpl.Backpack
end
end
end)
game.Players.PlayerAdded:Connect(function(player)
local success, boughtGamepass = pcall(function()
return game:GetService(“MarketplaceService”):UserOwnsGamePassAsync(player.UserId, 19237735)
end)
if success and boughtGamepass then
local winterStick = game:GetService("ServerStorage"):WaitForChild("WinterStick"):Clone()
winterStick.Parent = player.Backpack
local owinterstick = winterStick:Clone()
owinterstick.Parent = player.StarterGear
end