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

Using a RemoteEvent to create a GUI?

Server:

function Role:NightAbility(Player)
    createGUI.OnServerEvent:connect(function()
        **idk what goes here**
    end)
end

Local:

**idk what to put here**:Connect(function PlayerSelection()
    createGUI:FireServer()
end)

I want to create a RemoteEvent in the NightAbility function that runs the PlayerSelection function, which creates a ScreenGUI.

As you see, I'm still stuck on some parts.

Help?

2 comments

0

It would probably be best to use the remote event to clone the gui instead of making a gui in the code.

0

While that's a nice suggestion, I'd rather know how to DO this RemoteEvent CORRECTLY, and then figure out the best way to use it.

1 answer

Try this.. when a player is added, it will create this gui. [local script]

local gui = Instance.new('ScreenGui',game.Players.LocalPlayer.PlayerGui)
local frame = Instance.new('Frame',game.Players.LocalPlayer.PlayerGui.ScreenGui)
local button = Instance.new('TextButton',game.Players.LocalPlayer.PlayerGui.ScreenGui.Framei)

functioin addgui()
if game.Players.PlayerAdded
then frame.Visible = true
wait (0)
frame.Size = (0,0 0,0) -- x and y
wait (0)
button. -- customize it any way you please.
end
end
 -- this should be in Workspace
script.Parent.Parent.Players.PlayerAdded:connect (addgui)

if it doesn't work, let me know

1 comment

0

Also acknowledge my typo, it was meant to be frame, not "framei"

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