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

How do I make game passes work?(UNANSWERED)

Asked by 10 years ago

How would I make this script work? It keeps saying something about badges and the roblox server

-------------------
--| WaitForChild |--
--------------------

-- Waits for parent.child to exist, then returns it
local function WaitForChild(parent, childName)
    assert(parent, "ERROR: WaitForChild: parent is nil")
    while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
    return parent[childName]
end

-----------------
--| Variables |--
-----------------

local GamePassService = Game:GetService('GamePassService')
local PlayersService = Game:GetService('Players')
local InsertService = Game:GetService('InsertService')
local LightingService = Game:GetService('Lighting') --TODO: Use new data store service once that exists

gamepassid = 156137078

-----------------
--| Functions |--
-----------------

-- When a player with the game pass joins, give them the admin tools
local function OnPlayerAdded(player)
    if GamePassService:PlayerHasPass(player, gamepassid) then
        player.CharacterAdded:connect(
        function()
            wait(1)
            player.Character.Humanoid.WalkSpeed = 200
        end
        )
    end
end

PlayersService.PlayerAdded:connect(OnPlayerAdded)

0
You know, there's a WaitForChild on the C side. http://wiki.roblox.com/index.php?title=API:Instance/WaitForChild Destrings 406 — 10y
0
I got this script from ROBLOX models. It's not functioning for some reason. xolbStudios 127 — 10y

Answer this question