Hey Scripters, I have a quick question. I have a LocalScript in my frame; and it’s not cloning my frame.
local UIS = game:GetService("UserInputService")
local SGUI = game:GetService("StarterGui")
local Players = game:GetService("Players")
local Mouse = game.Players.LocalPlayer:GetMouse()
while wait() do
SGUI:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
end
Players.PlayerAdded:Connect(function(plr)
local Frame = script.Username:Clone()
Frame.Name = plr.Name
Frame.Team.Text = plr.Team.Name
Frame.Username.Text = plr.Name
Frame.Parent = script.Parent
print('added player')
while wait() do
local Found = script.Parent:FindFirstChild(plr.Name)
if Found then
Found.Team.Text = plr.Team.Name
end
end
end)
Players.PlayerRemoving:Connect(function(plr)
local Frame = script.Parent:FindFirstChild(plr.Name)
Frame:Destroy()
end)
UIS.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.Tab then
script.Parent.Parent.Visible = not script.Parent.Parent.Visible
print('tab clicked')
end
end)
--Mouse.KeyDown:Connect(function(key)
-- if key == Enum.KeyCode.Tab then
-- print('tab clicjked')
-- script.Parent.Parent.Visible = true
-- end
--end)
Why is it not cloning?
(And UIS is not working too)
I think it can only be called from the server, i’m not getting a print on playeradded because I added it to log it. So I think i should just do a remote event and fire all clients?