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 9 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.


plr = game.Players.LocalPlayer pass = 170156697 script.Parent.MouseButton1Click:connect(function() if Game:GetService("GamePassService"):PlayerHasPass(plr, pass) then if script.Parent.BackgroundColor3 == Color3.new(0,80/255,0) then for i,v in pairs(game.ReplicatedStorage.Sporks:GetChildren()) do if v:IsA("BasePart") then clone = v:Clone() clone.Parent = Workspace end end script.Parent.BackgroundColor3 = Color3.new(225/255,0,0) wait(10) script.Parent.BackgroundColor3 = Color3.new(0,80/255,0) end end end)
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 — 9y
0
Ok GetSporked 5 — 9y

Answer this question