I want to clone my Gui from replicated first but it’s not working.
Here’s the code:
local RF = script.Parent -- Replicated First
local IO = RF.LocalScript.InsertedObjects -- ScreenGui
local L = IO.load -- Load Frame
local Txt = L.text -- Text for loading
local PS = game:GetService("Players") -- PlayerService
local TS = game:GetService("TweenService") -- TweenService
PS.PlayerAdded:Connect(function(player)
local IOClone = IO:Clone()
IOClone.Parent = player.PlayerGui
end)
Server Scripts only run if they’re inside the workspace, or ServerScriptService
If this is a LocalScript I believe you could easily do that by just defining the Player as a variable:
local Player = game.Players.LocalPlayer
local RF = script.Parent
local IO = RF.LocalScript.InsertedObjects
local L = IO.load
local Txt = L.text
local PS = game:GetService("Players")
local TS = game:GetService("TweenService")
local IOClone = IO:Clone()
IOClone.Parent = Player:WaitForChild("PlayerGui")