Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

2 answers

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)

1 comment

0

Oh okay I will try

This discussion is preserved as it was. New answers, comments, and votes are closed.