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

Can you fix my broken gamepass run script for a gui? [closed]

Asked by 9 years ago
local passId = 252508600

function onClick(player)
    return game:GetService("GamePassService"):PlayerHasPass(player, passId)
end
 while true do
function onClick()
    if click then
        script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 16
        script.Parent.Text = "ON"
        click = false
    else
        script.Parent.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 36
        script.Parent.Text = "OFF"
        click = true
    end
end

click = false

script.Parent.MouseButton1Click:connect(onClick)

Closed as Not Constructive by evaera

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by
shayner32 478 Trusted Moderation Voter
9 years ago

You have this line:

script.Parent.MouseButton1Click:connect(onClick)

onClick is never defined as a function. Try changing

function isAuthenticated(player)

to

function onClick(player)
0
Oh okay I will try christiannewman 0 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

It didnt work :(