Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

how to use a local script in a click detector?

Asked by 10 days ago
Edited 10 days ago

Hello,

So i have been scripting my game and i have come upon this small problem which i'm not to sure how to fix. In this script i want once you click a button the button turns green and a GUI pops up. I tried this way but it still wont work:

The problem is the gui wont pop up

Local Script in click detector:

local plr = game.Players.LocalPlayer



game.ReplicatedStorage.PowerOnEvent.OnServerEvent:Connect(function()

plr.PlayerGui.Tutorial.Enabled = true``
end)

Could someone please help me with this problem.

0
You have no FireServer() to activate the RemoteEvent. Rookie mistake. RobloxWhizYT 1852 — 10d
0
The part that wont work is the gui wont pop up Hugo_XPGamer 4 — 10d
0
You still aren't using the RemoteEvent correctly. If you want to fire from the local script in the ClickDetector to a server script, FireServer() must be in the local script. No wonder why it isn't working. RobloxWhizYT 1852 — 10d
0
You're also better off receiving the ClickDetector's MouseClick event from the server then firing to the client. RobloxWhizYT 1852 — 10d
View all comments (6 more)
0
The fire server is being fired in a local script Hugo_XPGamer 4 — 10d
0
Where is the script located? RobloxWhizYT 1852 — 10d
0
in a local script u dont use OnServerEvent, instead u use OnClientEvent Gameplayer365247v2 166 — 10d
0
I will test it out. Hugo_XPGamer 4 — 9d
0
@Gameplayer365247v2 Stop with the bad answers. RobloxWhizYT 1852 — 9d
0
@RobloxWhizYT the local script is in starterGui Hugo_XPGamer 4 — 9d

Answer this question