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

Accessing a Local Script Through a Server Script?

Asked by 6 years ago

What I'm trying to do is update a GUI the player has when they click on a button in the workspace. However, I realized that the PlayerGui can't be accessed through a server script. Is there any way to access a local script through a server script? Sort of like a reverse RemoteEvent when the local script fires a server script. This is in Filtering Enabled

0
You can just use :FireClient(plr) and event.OnClientEvent???? User#20388 0 — 6y
0
http://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events ---- Look under Server to Client. You're exactly on the right track with a "reverse RemoteEvent". whenallthepigsfly 541 — 6y

1 answer

Log in to vote
0
Answered by
Leamir 3138 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago

Hello, InfernoExeuctioner!

Remote Events script:

local Event= Instance.new("RemoteEvent")
Event.Parent = game.ReplicatedStorage
Event.Name = "ChangeGuiEvent"

local script:

game.ReplicatedStorage.OnClientEvent:Connect(function()
    -- Change gui here
end)

Change using only a normal server script

-- This will change when the player click the scripts parent
script.Parent.ClickDetector.MouseButton1Click:Connect(function(plr)
    plr.PlayerGui. -- Here you are on the player gui folder =D, change the guis here
end)

Good Luck with your games!!

Ad

Answer this question