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

Button script fails to operate in a server script, can you please help me?

I have tried multiple solutions which all fail, I want to be able to click a button in a server script not a local one. I know its POSSIBLE because I have done this multiple times before but for some reason today it just does not want to work, I don't even get any errors.

Setup = script.Parent.Base.Setup
ContinueButton = script.Parent.Base.Setup.Continue

ContinueButton.MouseButton1Down:Connect(function()
	Setup.Visible = false
end)

1 answer

Yes. It is possible. I don't see any problems with your script. Try adding a "wait()". I used this Script in ServerScriptService for a Gui TextButton. I added "wait(3)" to the beginning because it wouldn't work if i didn't add it

Script:

wait(3)
for _,v in pairs(game.Players:GetDescendants()) do
	if v:IsA"TextButton" then
		v.MouseButton1Down:Connect(function()
			print("button clicked")
		end)
	end
end

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