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

Gamepass script help please?

Asked by 10 years ago

The wiki said I needed it in a script but I made it in a local script because the surface gui will not work to find the player then... I just need help figuring out what to do.

01plr = game.Players.LocalPlayer
02pass = 170156697
03script.Parent.MouseButton1Click:connect(function()
04    if Game:GetService("GamePassService"):PlayerHasPass(plr, pass) then
05        if script.Parent.BackgroundColor3 == Color3.new(0,80/255,0) then
06            for i,v in pairs(game.ReplicatedStorage.Sporks:GetChildren()) do
07                if v:IsA("BasePart") then
08                    clone = v:Clone()
09                    clone.Parent = Workspace
10                end
11            end
12            script.Parent.BackgroundColor3 = Color3.new(225/255,0,0)
13            wait(10)
14            script.Parent.BackgroundColor3 = Color3.new(0,80/255,0)
15        end
16    end
17end)
1
Suggestion:  comparing the background color to a constant is probably a bad idea. Some people are mistrustful of float comparison to begin with, but mostly this is just a brittle solution. Use a de-bounce like variable instead. BlueTaslem 18071 — 10y
0
Ok GetSporked 5 — 10y

Answer this question