Hiya! I want to make this choosing team GUI where it opens when the player joins.
Here is the code:
local RStorage = game.ReplicatedStorage local Event = RStorage:FindFirstChild("GuiOpen") local function OpenGui() script.Parent.Enabled = true end Event:FireServer(game.Players.PlayerAdded:Connect(OpenGui))
I have never used RemoteEvents
before. So I dont know what I can do with them.
This is a LocalScript
and it is parented under the ScreenGui
Script in ServerScriptService
local replicatedStorage = game:GetService("ReplicatedStorage") local enableGUIEvent = replicatedStorage:WaitForChild("EnableGUI") game.Players.PlayerAdded:Connect(function(plr) wait(1) enableGUIEvent:FireClient(plr) end)
LocalScript in ScreenGUI
local replicatedStorage = game:GetService("ReplicatedStorage") local enableGUIEvent = replicatedStorage:WaitForChild("EnableGUI") local screenGUI = script.Parent:WaitForChild("ScreenGui") enableGUIEvent.OnClientEvent:Connect(function(player,plr) screenGUI.Enabled = true end)
Notes make sure you set your ScreenGui's Enable property to false also make sure your order or whatever looks like this : https://media.discordapp.net/attachments/653682939024113689/672596993117519872/unknown.png