wait(3) if game.Players.LocalPlayer.userId == 21194847 then local a = 'Granted admin to ' local b = game.Players.LocalPlayer.Name player = game.Players.LocalPlayer print(a .. b) local chat = Instance.new("ScreenGui") chat.Parent = script.Parent chat.Name = 'chatMaster' chatLabeli = Instance.new("TextBox") wait(1) chatLabeli.Parent = chat chatLabeli.Position = UDim2.new(0, 863, 0, 447) chatLabeli.Size = UDim2.new(0, 225, 0, 15) chatLabeli.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) chatLabeli.BackgroundTransparency = 0.15 chatLabeli.BorderColor3= Color3.new(0.05, 0.05, 0.05) chatLabeli.TextColor3 = Color3.new(0.9, 0.9, 0.9) chatLabeli.Text = 'Console' chatLabeli.Name = 'chatLabel' chatLabeli.TextScaled = false chatLabeli.Active = true chatLabeli.ClearTextOnFocus = true end chatLabeli.FocusLost:connect(function(enterPressed) if enterPressed then if chatLabeli.Text == 'max' then game.Players.LocalPlayer.Character.Level.Value = 59 game.Players.LocalPlayer.Character.xp.Value = 999999999999999 game.Players.LocalPlayer.Character.Humanoid.Health = game.Players.LocalPlayer.Character.Humanoid.MaxHealth game.Players.LocalPlayer.Character.maxxp.Value = 10^10 end end end)
It seems the universe hates me because this is all happening for 0 reason and I have no idea how to fix it.
EDITED
Here is your problem!
Its called the unary scope.
You were trying to use a non-set variable outside the IF STATEMENT.
You only set it at the IF, so let's put the end further away.
wait(3) if game.Players.LocalPlayer.userId == 21194847 then --local a = 'Granted admin to ' dont need this local b = game.Players.LocalPlayer.Name local player = game.Players.LocalPlayer print("Granted admin to " .. b) local chat = Instance.new("ScreenGui") while not player:FindFirstChild("PlayerGui") do wait() end chat.Parent = player:FindFirstChild("PlayerGui") chat.Name = 'chatMaster' chatLabeli = Instance.new("TextBox") wait(1) chatLabeli.Parent = chat chatLabeli.Position = UDim2.new(0, 863, 0, 447) chatLabeli.Size = UDim2.new(0, 225, 0, 15) chatLabeli.BackgroundColor3 = Color3.new(0.05, 0.05, 0.05) chatLabeli.BackgroundTransparency = 0.15 chatLabeli.BorderColor3= Color3.new(0.05, 0.05, 0.05) chatLabeli.TextColor3 = Color3.new(0.9, 0.9, 0.9) chatLabeli.Text = 'Console' chatLabeli.Name = 'chatLabel' chatLabeli.TextScaled = false chatLabeli.Active = true chatLabeli.ClearTextOnFocus = true chatLabeli.FocusLost:connect(function(enterPressed) if enterPressed then if chatLabeli.Text == 'max' then game.Players.LocalPlayer.Character.Level.Value = 59 game.Players.LocalPlayer.Character.xp.Value = 999999999999999 game.Players.LocalPlayer.Character.Humanoid.Health = game.Players.LocalPlayer.Character.Humanoid.MaxHealth game.Players.LocalPlayer.Character.maxxp.Value = 10^10 end end end) end
Hope this helps! Thanks, ~marcoantoniosantos3