So basically what im trying to do is if a admin says ":givescoreboard (player)" it should Clone the gui to the Person. When i Test this script it does everything it clones the GUI to Replicated Storage but it does not clone it to the players GUI afterwards. Why is this? Server Script
local admins = {"dogopvain","RandamuHaise","Player1"}
local scoreboardValues = game.Workspace.ScoreboardValues
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if msg:sub(1, 16) == ":givescoreboard " then
for i = 1,#admins do
if plr.Name == admins[i] then
local addPlayer = msg:sub(17, msg:len())
print(addPlayer)
if game.Players:FindFirstChild(addPlayer) then
local manual = script.ManualGUI:Clone()
manual.Parent = game.ReplicatedStorage
print("Player has been found")
table.insert(admins, addPlayer)
game.ReplicatedStorage.GiveScoreBoard:FireClient()
else
print("Player has not been found")
end
end
end
end
end)
end)
game.Players.PlayerAdded:Connect(function(player)
local playerGui = player.PlayerGui
for i = 1,#admins do
if player.Name == admins[i] then
local manualGui = script:WaitForChild("ManualGUI")
local cloneGuiToPlayer = manualGui:Clone()
cloneGuiToPlayer.Parent = playerGui
if playerGui:FindFirstChild("ManualGUI") then return end
end
end
end)
Local Script
local rep = game:GetService("ReplicatedStorage")
rep.GiveScoreBoard.OnClientEvent:Connect(function()
print("Done")
if rep:WaitForChild("ManualGui") then
local manualGuiClone = rep.ManualGui:Clone()
manualGuiClone.Parent = game.Players.LocalPlayer.PlayerGui
end
end)

2 comments
Change line 16, adding just 'player' in the parameters and if that doesn't work, also add just 'player' in the parameters for line 3 of your localscript, hope this helps.
Does not seem to work idk why