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

Accessing a Local Script Through a Server Script?

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

2 comments

0

You can just use :FireClient(plr) and event.OnClientEvent????

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".

1 answer

✓ Accepted answer

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!!

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