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

PlayerAdded Not working?

Asked by 8 years ago

I have a script that is supposed to put items into StarterGear when they own a certain gamepass. What's strange is that it only works on my test server, but not any of the actual game servers. I'm guessing it's a problem with loading the player or the map or even MarketplaceService.

Please help, this is kind of urgent.

This is the script.

local passId = 430308264

local potato = game.Lighting:WaitForChild("Jetpack")


function isAuthenticated(player) 
    return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId)
end

game.Players.PlayerAdded:connect(function(player) -- player is already defined
    if isAuthenticated(player) then
        potato:Clone().Parent = player.StarterGear
        print(player.Name .. " HAS BOUGHT A JETPACK!")
    end
end)
0
does it give you the jetpack if you reset after you joined Nick1482 50 — 8y
0
Is this a Script or a Localscript? BlueTaslem 18071 — 8y
0
Is this a Script or a Localscript? BlueTaslem 18071 — 8y
0
Is this a Script or a Localscript? BlueTaslem 18071 — 8y
View all comments (5 more)
0
Is this a Script or a Localscript? BlueTaslem 18071 — 8y
0
Is this a Script or a Localscript? BlueTaslem 18071 — 8y
0
Is this a Script or a Localscript? BlueTaslem 18071 — 8y
0
Is this a Script or a Localscript? BlueTaslem 18071 — 8y
0
This is a script in workspace. SpazzMan502 133 — 8y

Answer this question