It's broken, not really anything else to say. Output is giving nothing.
local isAdmin = {["Z007"] = true, ["Player1"] = true}
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message)
if message:sub(1, 3) == "hp." and isAdmin[player.Name] then
person = findPlayer(message:sub(4))
if person and person.Character then
local msg = Instance.new("Hint", Workspace)
msg.Text = person.Character.Humanoid.Health
Delay(3,function()msg:Destroy()end)
end
end
if message:sub(1, 4) == "gui." and isAdmin[player.Name] then
msg = message:sub(5, 100)
if game.StarterGui.Z007guirules == false then
gui = Instance.new("ScreenGui") gui.Parent = game.StarterGui gui.Name = "Z007guirules"
frame = Instance.new("Frame") frame.Parent = game.StarterGui.ScreenGui
frame.Position = UDim2.new(0.25, 0, 0.01, 0)
frame.Size = UDim2.new(0.5, 0, 0.05, 0)
frame.Style = 3
text = Instance.new("TextLabel") text.Parent = game.StarterGui.ScreenGui.Frame
text.Text = msg
text.Position = UDim2.new(0.5, 0, 0.5, 0)
text.FontSize = 4
text.TextColor3 = Color3.new(255/255, 255/255, 255/255)
clone = game.Players:GetChildren()
for i = 1, #clone do
guiclone = gui:Clone()
guiclone.Parent = clone[i].PlayerGui
end
else
textme = game.Players:GetChildren()
for i = 1, #textme do
textme[i].PlayerGui.Text = msg
end
game.StarterGui.Z007guirules.Frame.TextLabel.Text = msg
end
end
end)
end)
function findPlayer(string)
for _,v in pairs(game:GetService("Players"):GetPlayers())do
if v.Name:lower():sub(1,string:len())==string:lower()then
return v
end
end
end |