This script does work properly it gives you the weapon, but it only gives it to you when you join another new server. Any help on how to fix this? I've been wondering around with this script much in why it does that.

wait(2) 

gpid = 223931418
tools = {"Bren"}

GPS = game:GetService("GamePassService")
function respawned(char)
local player = game.Players:FindFirstChild(char.Name)
if char:FindFirstChild("Head") ~= nil then
print("It's a Player!")
if GPS:PlayerHasPass(player, gpid) then
print("Has GPID")
for i = 1,#tools do
game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.Backpack
end
else
print("No GPID")
end
end
end
game.Workspace.ChildAdded:connect(respawned)

9 comments

1

It's just the way Roblox's service works.

0

So theres no way to change that?

0

Not that I know of, although you could use Developer Products.

0

Just go to "Game Instances" and click "Shut down all servers"

0

How would that work? Will it give the gun there in-game without joining another server?

0

Because, if it doesn't work in old servers and It works in new ones, shutting down the server will cause all the old servers to shut down making only the new ones run.

0

Didnt mean to reply it to you Lord I meant to reply Perci's comment

0

If there is a way to detect when the player purchases the pass (I haven't checked), you could have a temporary "player purchased pass" dictionary; the above code could then check that dictionary in addition to using Roblox's service.

0

Can you answer the question with the script?