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

[Solved] Why Wont basic remote event create GUI?

I have done Debugging and the code is running with no error and the GUI's are being stored in the right place. Is there a certain property of the UI's i should change?

Code is as follows (There is nothing in the fire all clients side):

local rep = game.ReplicatedStorage.RemoteEvent
rep.OnClientEvent:Connect(function()
local GUI = Instance.new("ScreenGui")
local Text = Instance.new("TextBox")

Text.Text = "Fart"
GUI.Parent = game.StarterGui
Text.Parent = GUI

wait(2)
print(Text.Parent.Parent)
end)

2 answers

[Solved] I needed to give the text box a size parameter with Udim2

LocalScript that is needed to start the Event can't reach ReplicatedStorage, try moving Event into the workspace, script into event and instead of putting Gui in the StarterGui put it in PlayerGui to prevent giving player same gui a few times.

Script(inside event):

local rep = game.ReplicatedStorage.RemoteEvent
rep.OnClientEvent:Connect(function(plr)
local GUI = Instance.new("ScreenGui")
local Text = Instance.new("TextBox")
Text.Text = "Fart"
GUI.Parent = game.Players.plr.PlayerGui
Text.Parent = GUI
end)

LocalScript(StarterPlayer > StarterPlayerScript/StarterCharacterScript):

workspace.RemoteEvent:FireServer()

3 comments

1

What. The. Heck.

1

This is very wrong. LocalScripts can access ReplicatedStorage from anywhere in the game.

0

sorry then :<

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