Skip to content

Commit

Permalink
remove unused instance stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdotink committed Nov 30, 2023
1 parent 3c80e55 commit 62a7571
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions lib/init.luau
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")

local Remote
local ClientFolder
if RunService:IsServer() then
if ReplicatedStorage:FindFirstChild("RedEvent") then
Remote = ReplicatedStorage:FindFirstChild("RedEvent") :: RemoteEvent
Expand All @@ -14,28 +12,10 @@ if RunService:IsServer() then
end

require(script.ServerEvent).Start()

local function PlayerAdded(Player: Player)
local ClientFolder = Instance.new("ScreenGui")

ClientFolder.Enabled = false
ClientFolder.ResetOnSpawn = false
ClientFolder.Name = "Red"
ClientFolder.Parent = Player:FindFirstChild("PlayerGui")
end

Players.PlayerAdded:Connect(PlayerAdded)

for _, Player in Players:GetPlayers() do
PlayerAdded(Player)
end
else
Remote = ReplicatedStorage:WaitForChild("RedEvent") :: RemoteEvent

require(script.ClientEvent).Start()

ClientFolder = (Players.LocalPlayer:FindFirstChild("PlayerGui") :: PlayerGui):WaitForChild("Red") :: ScreenGui
ClientFolder.Parent = nil
end

return {
Expand Down

0 comments on commit 62a7571

Please sign in to comment.