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 3 months ago
Edited 3 months 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. BashCaster 2200 — 3mo
0
The part that wont work is the gui wont pop up Hugo_XPGamer 4 — 3mo
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. BashCaster 2200 — 3mo
0
You're also better off receiving the ClickDetector's MouseClick event from the server then firing to the client. BashCaster 2200 — 3mo
View all comments (6 more)
0
The fire server is being fired in a local script Hugo_XPGamer 4 — 3mo
0
Where is the script located? BashCaster 2200 — 3mo
0
in a local script u dont use OnServerEvent, instead u use OnClientEvent Gameplayer365247v2 551 — 3mo
0
I will test it out. Hugo_XPGamer 4 — 3mo
0
@Gameplayer365247v2 Stop with the bad answers. BashCaster 2200 — 3mo
0
@RobloxWhizYT the local script is in starterGui Hugo_XPGamer 4 — 3mo

Answer this question