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

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

Asked by 3 years ago
Edited 3 years ago

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)
0
I don't understand what you need exactly. rabbi99 714 — 3y
0
basically i want to make a text button gui that when you click, makes a frame visible to every player in game robloxs_gamemaker 13 — 3y

1 answer

Log in to vote
0
Answered by
souflee 50
3 years ago

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 ^_^

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)". souflee 50 — 3y
Ad

Answer this question