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

Im trying to make a function on Click script i need help. what to do?

basically i want to make a text button gui that when you click, makes a frame visible to every player in game

function onClick()
	wait()
	game.Players.LocalPlayer.PlayerGui.spawn.fade.Visible = true
	
end

script.Parent.MouseButton1Click:connect(onClick)

2 comments

0

I don't understand what you need exactly.

0

basically i want to make a text button gui that when you click, makes a frame visible to every player in game

1 answer

✓ Accepted answer

Hey there,

Alright so first off it's important to know that you can't just reach the local player like that via a server sided script. You can, however get it by writing this:

script.Parent.MouseClick:Connect(function(plr)
-- 'plr' refers to the local player.
end)

Additionally, this article should help you out: https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events

Look at how to do "server -> all clients".

Happy scripting! Please give an upvote if this helped, and if it didn't - be sure to ask again ^_^

1 comment

0

Oh, oops sorry. I read it wrong (thought you meant a clickdetector). Try looking into the article I sent you, but instead read "Client -> Client(s)".

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