Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't this script work properly in which you need to join a new server for it to work?

Asked by 9 years ago

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)
1
It's just the way Roblox's service works. Perci1 4988 — 9y
0
So theres no way to change that? alan3401 28 — 9y
0
Not that I know of, although you could use Developer Products. Perci1 4988 — 9y
0
Just go to "Game Instances" and click "Shut down all servers" EzraNehemiah_TF2 3552 — 9y
View all comments (5 more)
0
How would that work? Will it give the gun there in-game without joining another server? alan3401 28 — 9y
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. EzraNehemiah_TF2 3552 — 9y
0
Didnt mean to reply it to you Lord I meant to reply Perci's comment alan3401 28 — 9y
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. chess123mate 5873 — 9y
0
Can you answer the question with the script? alan3401 28 — 9y

Answer this question