Use the code @SOTR654 provided, that will fix your issue. It’s a few posts up.
game.Players.PlayerAdded:Connect(function(player)
local Success, Has = pcall(function()
return game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 19237750)
end)
if Success and Has then
local frozenStick = game:GetService("ServerStorage"):WaitForChild("FrozenStick"):Clone()
frozenStick.Parent = player.Backpack
end
end)
A pcall() is used to check if the given function works, Success will return true or false depending on whether an error does not jump and can return something, if an error occurs, it will say the error, if not it will return true or false if the player has the game pass.
local Success, Number = pcall(function()
return "number " + 4
end)
print(Success, Number) -- False, attempt to perform arithmetic (add) on string and number
local Success, Number = pcall(function()
return "number " .. 4
end)
print(Success, Number) -- true, "number 4"
Yeah I would feel bad claiming a solution even though you said it before (even without realizing that was the issue).
What made me believe that it was a LocalScript was the “local player = game.Players.LocalPlayer” + the fact that the tool didn’t show up on my side but did on his side. This pretty much only happens when a LocalScript tries to get a tool, but the server doesn’t know that he has that tool thus creating the illusion that he was wielding one. Pretty much only exploiters do this.
If the script of a tool is local, it will continue to work regardless of whether it is cloned by the client or the server, whereas a script from the server will not work if it is cloned by a client.
(Looking at the problem again, I don’t know why I thought the tool script was local)