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

GamePassService Gamepass Problem?

Asked by
KordGamer 155
8 years ago

When my script checks if a player has a gamepass, It does it successfully (no errors) but doesn't give the trail (ParticleEmitter). I don't know why, I've tried a lot of things to fix it.

Here's the script:

print("script loaded")


game.Players.PlayerAdded:connect(function(player)
    local GamepassService = game:GetService("GamePassService")
    player:WaitForDataReady()
    player.CharacterAdded:connect(function()
        if GamepassService:PlayerHasPass(player, 389785824) then
            local ServerStorage = game.ServerStorage
            local p = ServerStorage.TrailStorage:WaitForChild("Simplism")
            local p2 = p:Clone()
            local Char = game.Workspace:WaitForChild(player.Name)

            p2.Parent = Char.Torso
        else
            print("plr doesn't own asset 389785824")
        end
    end)
end)

Any help is appreciated. Thanks!

1 answer

Log in to vote
0
Answered by 8 years ago

Your game pass part of the script is fine. Don't use server storage use replicated storage instead.

0
And if that fails try adding a delay or wait. ChrisCoder 0 — 8y
0
Alright, Thanks. KordGamer 155 — 8y
0
Still doesn't work, and I added the wait(). KordGamer 155 — 8y
Ad

Answer this question