local Rayfield = loadstring(game:HttpGet('https://[Log in to view URL]'))() local Window = Rayfield:CreateWindow({ Name = "Spicys NA GUI", LoadingTitle = "Spicy GUI Interface", LoadingSubtitle = "by Spicy", ConfigurationSaving = { Enabled = false, FolderName = nil, -- Create a custom folder for your hub/game FileName = "SpicyNAGUI" }, Discord = { Enabled = true, Invite = "kcEnxPkZ7M", -- The Discord invite code, do not include discord.gg/. E.g. discord.gg/ABCD would be ABCD RememberJoins = true -- Set this to false to make them join the discord every time they load it up }, KeySystem = true, -- Set this to true to use our key system KeySettings = { Title = "NA GUI | KEY", Subtitle = "LINK IN DISCORD", Note = "Join The Discord Server for the Key", FileName = "GUIKEYNA", -- It is recommended to use something unique as other scripts using Rayfield may overwrite your key file SaveKey = true, -- The user's key will be saved, but if you change the key, they will be unable to use your script GrabKeyFromSite = true, -- If this is true, set Key below to the RAW site you would like Rayfield to get the key from Key = {"https://[Log in to view URL]"} -- List of keys that will be accepted by the system, can be RAW file links (pastebin, github etc) or simple strings ("hello","key22") } }) local MainTab = Window:CreateTab("Home", nil) -- Title, Image local Section = MainTab:CreateSection("Main Scripts") local MiscTab = Window:CreateTab("Misc", nil) -- Title, Image Rayfield:Notify({ Title = "Script Executed", Content = "Press Okay", Duration = 7.5, Image = 4483362458, Actions = { -- Notification Buttons Ignore = { Name = "Okay", Callback = function() print("The user tapped Okay!") end }, }, }) local Button = MainTab:CreateButton({ Name = "AutoTrain - 10", Callback = function() -- The function that takes place when the button is pressedocal vu = game:GetService("VirtualUser") local train = game.ReplicatedStorage:WaitForChild("RemoteEvent"):WaitForChild("AddPowerEvent") game.Players.LocalPlayer.Idled:Connect(function() vu:Button2Down(Vector2.new(0, 0), workspace.CurrentCamera.CFrame) wait(1) vu:Button2Up(Vector2.new(0, 0), workspace.CurrentCamera.CFrame) end) while true do game.ReplicatedStorage.RemoteEvent.AddPowerEvent:FireServer("FromTraining",10) wait(0.7) game.ReplicatedStorage.RemoteEvent.AddPowerEvent:FireServer("FromTraining",9.99) wait(0.7) end end, }) local Button = MainTab:CreateButton({ Name = "AutoTrain - 20", Callback = function() -- The function that takes place when the button is pressed local vu = game:GetService("VirtualUser") local train = game.ReplicatedStorage:WaitForChild("RemoteEvent"):WaitForChild("AddPowerEvent") game.Players.LocalPlayer.Idled:Connect(function() vu:Button2Down(Vector2.new(0, 0), workspace.CurrentCamera.CFrame) wait(1) vu:Button2Up(Vector2.new(0, 0), workspace.CurrentCamera.CFrame) end) while true do game.ReplicatedStorage.RemoteEvent.AddPowerEvent:FireServer("FromTraining",20) wait(0.7) game.ReplicatedStorage.RemoteEvent.AddPowerEvent:FireServer("FromTraining",19.99) wait(0.7) end end, }) local MovementTab = Window:CreateTab("Movement", nil) -- Title, Image local Input = MovementTab:CreateInput({ Name = "Speed", PlaceholderText = "1-200", RemoveTextAfterFocusLost = true, Callback = function(Text) game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = (Text) end, }) local TeleportTab = Window:CreateTab("Teleport", nil) -- Title, Image local Button = TeleportTab:CreateButton({ Name = "Teleport to Mountain", Callback = function() local pos = Vector3.new(-484, 352, -84) game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(pos) end, }) local Button = TeleportTab:CreateButton({ Name = "Teleport to Arena", Callback = function() local pos = Vector3.new(-185, 97, -315) game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(pos) end, }) local Button = TeleportTab:CreateButton({ Name = "Teleport to Forest", Callback = function() local pos = Vector3.new(78, 135, 55) game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(pos) end, }) local Button = MainTab:CreateButton({ Name = "Leaderstats Improver", Callback = function() while not game:IsLoaded() or not game:GetService("CoreGui") or not game:GetService("Players").LocalPlayer or not game:GetService("Players").LocalPlayer.PlayerGui or not game:GetService("CoreGui"):FindFirstChild("TopBarApp") or not game:GetService("CoreGui"):FindFirstChild("PlayerList") or not game.Players.LocalPlayer.Character do wait() end local on = true if not on then return end local PlaceValues = { [823323202] = 1; } if not PlaceValues[game.PlaceId] then return end repeat task.wait(0.1) until game.Players.LocalPlayer:FindFirstChild("leaderstats") local numofstats = 0 for i,v in ipairs(game.Players.LocalPlayer:FindFirstChild("leaderstats"):GetChildren()) do numofstats = numofstats + 1 end local numnum = numofstats * 110 local xvalue = numnum + 172 local divxvalue = xvalue - 110 local coregui = game:GetService("CoreGui") local playerlist = coregui:WaitForChild("PlayerList") local Teams = game:GetService("Teams") local Players = game:GetService("Players") local plrsandteams = playerlist:WaitForChild("PlayerListMaster").OffsetFrame.PlayerScrollList.SizeOffsetFrame.ScrollingFrameContainer.ScrollingFrameClippingFrame.ScollingFrame.OffsetUndoFrame local titlebar = playerlist.PlayerListMaster.OffsetFrame.PlayerScrollList.SizeOffsetFrame:WaitForChild("TitleBar") local suffixes = {'','K+','M+','B+','T+','qd+','Qn+','sx+','Sp+','O+','N+','de+','Ud+','DD+','tdD+','qdD+','QnD+','sxD+','SpD+','OcD+','NvD+','Vgn+','UVg+','DVg+','TVg+','qtV+','QnV+','SeV+','SPG+','OVG+','NVG+','TGN+','UTG+','DTG+','tsTG+','qtTG+','QnTG+','ssTG+','SpTG+','OcTG+','NoAG+','UnAG+','DuAG+','TeAG+','QdAG+','QnAG+','SxAG+','SpAG+','OcAG+','NvAG+','CT+'} local TeamValues = {} local PlayerValues = {} local Exceptions = { ['Reputation'] = 1; ['Power'] = 1; } local LBExceptions = { ['Realm'] = 150; } local function comma_value(n) if tonumber(n) then local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$') return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right else return n end end local function format(val) if tonumber(val) then local negative = false if string.sub(val,1,1) == "-" then val = string.sub(val,2,string.len(val)) negative = true end for i=1, #suffixes do if tonumber(val) < 10^(i*3) then local value = math.floor(val/((10^((i-1)*3))/100))/(100)..suffixes[i] if negative then value = "-"..value end return value end end else return val end end local function GetPlayer(text) for _,Player in pairs(game.Players:GetPlayers()) do if string.sub(string.lower(Player.Name),1,string.len(text)) == string.lower(text) then return Player elseif string.sub(string.lower(Player.DisplayName),1,string.len(text)) == string.lower(text) then return Player elseif Player.UserId == tonumber(text) then return Player end end end local function UpdateTeamValues() for i,v in pairs(TeamValues) do TeamValues[i] = 0 end local plr for i,v in pairs(Players:GetPlayers()) do if v:FindFirstChild("leaderstats") then plr = v for i,v in pairs(v:FindFirstChild("leaderstats"):GetChildren()) do if tonumber(v.Value) then TeamValues[plr.Team.Name.."_"..v.Name] = TeamValues[plr.Team.Name.."_"..v.Name] + v.Value end end end end for i,v in pairs(plrsandteams:GetChildren()) do if string.sub(v.Name,1,1) == "t" then for i,v in pairs(v:GetChildren()) do if string.lower(string.sub(v.Name,1,8)) == "gamestat" then local statname = string.sub(v.Name,10,string.len(v.Name)) if Exceptions[statname] then if tonumber(TeamValues[v.Parent.NameFrame.BGFrame.OverlayFrame.TeamName.Text.."_"..statname]) then v.OverlayFrame.StatText.Text = format(TeamValues[v.Parent.NameFrame.BGFrame.OverlayFrame.TeamName.Text.."_"..statname]) else v.OverlayFrame.StatText.Text = "-" end else if tonumber(TeamValues[v.Parent.NameFrame.BGFrame.OverlayFrame.TeamName.Text.."_"..statname]) then v.OverlayFrame.StatText.Text = comma_value(TeamValues[v.Parent.NameFrame.BGFrame.OverlayFrame.TeamName.Text.."_"..statname]) else v.OverlayFrame.StatText.Text = "-" end end end end end end end local function UpdatePlayerStats(plr) repeat task.wait(0.1) until plr:FindFirstChild("leaderstats") for i,v in pairs(plr:FindFirstChild("leaderstats"):GetChildren()) do if not PlayerValues[plr.Name.."_"..v.Name] then PlayerValues[plr.Name.."_"..v.Name] = 0 end PlayerValues[plr.Name.."_"..v.Name] = v.Value end for i,v in pairs(plrsandteams:GetChildren()) do if string.sub(v.Name,1,1) == "p" then if GetPlayer(string.sub(v.Name,3,string.len(v.Name))) == plr then for i,v in pairs(v.ChildrenFrame:GetChildren()) do if string.lower(string.sub(v.Name,1,8)) == "gamestat" then local statname = string.sub(v.Name,10,string.len(v.Name)) if Exceptions[statname] then v.OverlayFrame.StatText.Text = format(PlayerValues[plr.Name.."_"..statname]) else v.OverlayFrame.StatText.Text = comma_value(PlayerValues[plr.Name.."_"..statname]) end end end end end end end local function UpdatePlayerListSize() for i,v in pairs(plrsandteams:GetChildren()) do if string.sub(v.Name,1,1) == "t" then for i,v in pairs(v:GetChildren()) do if v.Name == "BackgroundExtender" then if v.Size ~= UDim2.new(1,0,1,0) then v.Size = UDim2.new(1,0,1,0) end end if string.lower(string.sub(v.Name,1,8)) == "gamestat" then local statname = string.sub(v.Name,10,string.len(v.Name)) if v.Size ~= UDim2.new(1,-divxvalue,1,0) then v.Size = UDim2.new(1,-divxvalue,1,0) end end end elseif string.sub(v.Name,1,1) == "p" then for i,v in pairs(v.ChildrenFrame:GetChildren()) do if v.Name == "BackgroundExtender" then if v.Size ~= UDim2.new(1,0,1,0) then v.Size = UDim2.new(1,0,1,0) end end if string.lower(string.sub(v.Name,1,8)) == "gamestat" then local statname = string.sub(v.Name,10,string.len(v.Name)) if v.Size ~= UDim2.new(1,-divxvalue,1,0) then v.Size = UDim2.new(1,-divxvalue,1,0) end end end end end for i,v in pairs(titlebar.ChildrenFrame:GetChildren()) do if string.lower(string.sub(v.Name,1,4)) == "stat" then local statname = string.sub(v.Name,10,string.len(v.Name)) if v.Size ~= UDim2.new(1,-divxvalue,1,0) then v.Size = UDim2.new(1,-divxvalue,1,0) end end end end for i,v in pairs(game.Teams:GetChildren()) do local teamname = v.Name for i,v in pairs(Players.LocalPlayer:FindFirstChild("leaderstats"):GetChildren()) do TeamValues[teamname.."_"..v.Name] = 0 end end for i,v in pairs(Players:GetPlayers()) do task.spawn(function() repeat task.wait() until v:FindFirstChild("leaderstats") if v:FindFirstChild("leaderstats") then local plr = v for i,v in pairs(v:FindFirstChild("leaderstats"):GetChildren()) do v:GetPropertyChangedSignal("Value"):Connect(function() UpdateTeamValues() UpdatePlayerStats(plr) end) end UpdatePlayerStats(plr) end UpdatePlayerListSize() end) end Players.PlayerAdded:Connect(function(plr) repeat task.wait() until plr:FindFirstChild("leaderstats") repeat task.wait() local plrnumofstats = 0 for i,v in ipairs(plr:FindFirstChild("leaderstats"):GetChildren()) do plrnumofstats = plrnumofstats + 1 end until plrnumofstats == numofstats for i,v in pairs(plr:FindFirstChild("leaderstats"):GetChildren()) do v:GetPropertyChangedSignal("Value"):Connect(function() UpdateTeamValues() UpdatePlayerStats(plr) end) end task.wait(0.5) UpdatePlayerStats(plr) UpdatePlayerListSize() end) Players.PlayerRemoving:Connect(function(plr) UpdateTeamValues() end) playerlist.PlayerListMaster.Size = UDim2.new(0,xvalue,0,680) UpdatePlayerListSize() task.spawn(function() while task.wait(1) do for i,plr in pairs(Players:GetPlayers()) do UpdatePlayerStats(plr) end UpdateTeamValues() UpdatePlayerListSize() end end) end, }) local Input = MovementTab:CreateInput({ Name = "Jump Power (May Not Work)", PlaceholderText = "1-200", RemoveTextAfterFocusLost = true, Callback = function(Text) game.Players.LocalPlayer.Character.Humanoid.JumpPower = (Text) end, }) local Button = MainTab:CreateButton({ Name = "Aimbot (E to Target, Q to Fire, Z to turn On/Off)", Callback = function() local ScreenGui2 = { ScreenGui2 = Instance.new("ScreenGui"), CommandBarFrame = Instance.new("Frame"), CommandBar = Instance.new("TextBox"), CommandBarCorner = Instance.new("UICorner"), } ScreenGui2.ScreenGui2.Name = "ScreenGui2" ScreenGui2.ScreenGui2.Parent = game:GetService("CoreGui") ScreenGui2.ScreenGui2.ResetOnSpawn = false ScreenGui2.ScreenGui2.ZIndexBehavior = Enum.ZIndexBehavior.Global ScreenGui2.CommandBarFrame.Name = "CommandBarFrame" ScreenGui2.CommandBarFrame.Parent = ScreenGui2.ScreenGui2 ScreenGui2.CommandBarFrame.AnchorPoint = Vector2.new(0.5, 0) ScreenGui2.CommandBarFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50) ScreenGui2.CommandBarFrame.Position = UDim2.new(0.5, 0, 1, 0) ScreenGui2.CommandBarFrame.Size = UDim2.new(0.0933617353, 0, 0.0327022374, 0) ScreenGui2.CommandBarFrame.BackgroundTransparency = 1 ScreenGui2.CommandBar.Name = "CommandBar" ScreenGui2.CommandBar.Parent = ScreenGui2.CommandBarFrame ScreenGui2.CommandBar.BackgroundColor3 = Color3.fromRGB(255, 255, 255) ScreenGui2.CommandBar.BackgroundTransparency = 1.000 ScreenGui2.CommandBar.Size = UDim2.new(1, 0, 1, 0) ScreenGui2.CommandBar.ClearTextOnFocus = false ScreenGui2.CommandBar.Font = Enum.Font.Gotham ScreenGui2.CommandBar.Text = "" ScreenGui2.CommandBar.TextColor3 = Color3.fromRGB(255, 255, 255) ScreenGui2.CommandBar.TextScaled = true ScreenGui2.CommandBar.TextSize = 14.000 ScreenGui2.CommandBar.TextWrapped = true ScreenGui2.CommandBarCorner.Parent = ScreenGui2.CommandBarFrame local Players = game:GetService("Players") local RunService = game:GetService("RunService") local CurrentCamera = workspace:WaitForChild("Camera") local UserInputService = game:GetService("UserInputService") local GuiService = game:GetService("GuiService") local plr = Players.LocalPlayer local mouse = plr:GetMouse() local target = nil local player = nil local lock = false local commandbarvisible = false local HRPLock = false local HRPLocking = false local traintoggle = true local prefix = "." local WhitelistedPlayers = {} local commands = {} local HRPSettings = { HRP_Player = nil; HRP_Position = nil; HRP_Part = "HumanoidRootPart"; Draw_HRP = HRPLock; HRP_Radius = 5; HRP_Color = Color3.fromRGB(0,255,0); HRP_UnselectedTransparency = 0.5; HRP_SelectedTransparency = 0.8; } local FOVsettings = { FOV_Player; FOV_Position = nil; AimPart = "Head"; TeamCheck = false; Draw_FOV = FOVLock; FOV_Radius = 200; FOV_Color = Color3.fromRGB(255,255,255); } local hrpcircle = Drawing.new("Circle") hrpcircle.Visible = HRPSettings.Draw_HRP hrpcircle.Radius = HRPSettings.HRP_Radius hrpcircle.Color = HRPSettings.HRP_Color hrpcircle.Thickness = 1 hrpcircle.Filled = true hrpcircle.Transparency = HRPSettings.HRP_UnselectedTransparency hrpcircle.Position = Vector2.new(0,0) local function chat(message) game.StarterGui:SetCore("ChatMakeSystemMessage", {Text = message, Color = Color3.fromRGB(0,255,0), Font = Enum.Font.Fantasy}) end local function GetPlayer(sender,text) if text == "" then return nil end if text == "all" then return "all" end for _,Player in pairs(Players:GetPlayers()) do if string.sub(string.lower(Player.Name),1,string.len(text)) == string.lower(text) then return Player elseif string.sub(string.lower(Player.DisplayName),1,string.len(text)) == string.lower(text) then return Player end end return nil end function CreateTween(object, info, args, play) local tween = game:GetService("TweenService"):Create(object, info, args) if play == "NoWait" or play == true then tween:Play() tween.Completed:Connect(function() tween:Destroy() end) return elseif play == "Wait" then tween:Play() tween.Completed:Wait() tween:Destroy() return end return tween end function ClosestTPToCursor() local ClosestChar = nil local ClosestPart = nil local ClosestPartPosition = nil local ClosestPartOnScreen = false local ClosestPartMagnitudeFromMouse = nil local ShortestDistance = math.huge for i,v in ipairs(Players:GetPlayers()) do local char = v.Character if char then if v ~= Players.LocalPlayer and not table.find(WhitelistedPlayers,v.Name) then local TargetPart = char:FindFirstChild(FOVsettings.AimPart) if TargetPart then local PartPos, onScreen = CurrentCamera.WorldToViewportPoint(CurrentCamera, TargetPart.Position) if onScreen then local Magnitude = (Vector2.new(PartPos.X, PartPos.Y) - Vector2.new(mouse.X, mouse.Y + GuiService.GetGuiInset(GuiService).Y)).Magnitude if (Magnitude < ShortestDistance) then ClosestChar = char ClosestPart = TargetPart ClosestPartPosition = PartPos ClosestPartOnScreen = onScreen ClosestPartMagnitudeFromMouse = Magnitude ShortestDistance = Magnitude end end end end end end return ClosestChar, ClosestPart, ClosestPartPosition, ClosestPartOnScreen, ClosestPartMagnitudeFromMouse end function ClosestHRPPlayer() local target = nil local TargetChar, TargetPartTemp, PartPos, onScreen, Magnitude = ClosestTPToCursor() target = TargetChar return Players:GetPlayerFromCharacter(target) end RunService.Heartbeat:Connect(function() if HRPLock == true then if HRPSettings.HRP_Player == nil then if ClosestHRPPlayer() ~= nil and ClosestHRPPlayer().Character then local hrpplayer = ClosestHRPPlayer().Character local vector, onscreen = CurrentCamera:WorldToViewportPoint(hrpplayer:FindFirstChild(HRPSettings.HRP_Part).Position) if hrpcircle.Transparency ~= HRPSettings.HRP_UnselectedTransparency then hrpcircle.Transparency = HRPSettings.HRP_UnselectedTransparency end if onscreen == true then if hrpcircle.Visible == false then hrpcircle.Visible = true end hrpcircle.Position = Vector2.new(vector.X,vector.Y) elseif onscreen == false then hrpcircle.Visible = false end else hrpcircle.Visible = false end elseif HRPSettings.HRP_Player ~= nil and HRPSettings.HRP_Player.Character then local enemy = HRPSettings.HRP_Player.Character local vector, onscreen = CurrentCamera:WorldToViewportPoint(enemy:FindFirstChild(HRPSettings.HRP_Part).Position) if hrpcircle.Transparency ~= HRPSettings.HRP_SelectedTransparency then hrpcircle.Transparency = HRPSettings.HRP_SelectedTransparency end if onscreen then if hrpcircle.Visible == false then hrpcircle.Visible = true end hrpcircle.Position = Vector2.new(vector.X,vector.Y) elseif onscreen == false then hrpcircle.Visible = false end else hrpcircle.Visible = false end elseif HRPLock == false then if hrpcircle.Visible ~= false then hrpcircle.Visible = false end end end) UserInputService.InputBegan:Connect(function(input, processed) if input.KeyCode == Enum.KeyCode.Quote then local textbox = ScreenGui2.CommandBar local frame = ScreenGui2.CommandBarFrame if commandbarvisible == false then CreateTween(frame,TweenInfo.new(0.2,Enum.EasingStyle.Quad),{Position = UDim2.new(0.5,0,0.9,0)},true) CreateTween(frame,TweenInfo.new(0.2,Enum.EasingStyle.Quad),{BackgroundTransparency = 0},true) textbox:CaptureFocus() task.wait() textbox.Text = "" commandbarvisible = true end end end) ScreenGui2.CommandBar.FocusLost:Connect(function() if commandbarvisible == true then ScreenGui2.CommandBar.Text = "" CreateTween(ScreenGui2.CommandBarFrame,TweenInfo.new(0.2,Enum.EasingStyle.Quad),{Position = UDim2.new(0.5,0,1,0)},true) CreateTween(ScreenGui2.CommandBarFrame,TweenInfo.new(0.2,Enum.EasingStyle.Quad),{BackgroundTransparency = 1},true) commandbarvisible = false end end) UserInputService.InputBegan:Connect(function(input, processed) if input.KeyCode == Enum.KeyCode.E and not processed then if HRPSettings.HRP_Player == nil and ClosestHRPPlayer() ~= nil and ClosestHRPPlayer().Character then HRPLocking = true if not HRPLock then return end local lockplr = ClosestHRPPlayer() HRPSettings.HRP_Player = lockplr elseif HRPSettings.HRP_Player ~= nil then HRPLocking = false if not HRPLock then return end HRPSettings.HRP_Player = nil end elseif input.KeyCode == Enum.KeyCode.Z and not processed then HRPLock = not HRPLock hrpcircle.Visible = HRPLock elseif input.KeyCode == Enum.KeyCode.Q and not processed then if lock == false then lock = false task.wait() lock = true while lock do if HRPSettings.HRP_Player and HRPSettings.HRP_Player.Character and HRPSettings.HRP_Player.Character:FindFirstChild("Head") and Players.LocalPlayer.Character and Players.LocalPlayer.Character:FindFirstChild("Shuriken") and Players.LocalPlayer.Character:FindFirstChild("Shuriken"):FindFirstChild("HitEvent") then Players.LocalPlayer.Character:FindFirstChild("Shuriken"):FindFirstChild("HitEvent"):FireServer(HRPSettings.HRP_Player.Character:FindFirstChild("Head").Position) end task.wait() end else lock = false end end end) Players.PlayerRemoving:Connect(function(plrremoved) if plrremoved == HRPSettings.HRP_Player then HRPSettings.HRP_Player = nil end end) commands.lock = function(sender,args) local player = GetPlayer(sender,args[1]) if player ~= nil then HRPSettings.HRP_Player = player end end commands.fire = function(sender,args) lock = false task.wait() lock = true while lock do if HRPSettings.HRP_Player and HRPSettings.HRP_Player.Character and HRPSettings.HRP_Player.Character:FindFirstChild("Head") and Players.LocalPlayer.Character and Players.LocalPlayer.Character:FindFirstChild("Shuriken") and Players.LocalPlayer.Character:FindFirstChild("Shuriken"):FindFirstChild("HitEvent") then Players.LocalPlayer.Character:FindFirstChild("Shuriken"):FindFirstChild("HitEvent"):FireServer(HRPSettings.HRP_Player.Character:FindFirstChild("Head")) elseif HRPSettings.HRP_Player == nil then lock = false end task.wait() end end commands.unfire = function(sender,args) lock = false end commands.wl = function(sender,args) if not GetPlayer(sender,args[1]) then chat("Server: Player does not exist") return end local player = GetPlayer(sender,args[1]) if table.find(WhitelistedPlayers,player.Name) then chat("Server: "..player.Name.." is already in Whitelist") return end table.insert(WhitelistedPlayers,player.Name) chat("Server: Added "..player.Name.." to the Whitelist") end commands.unwl = function(sender,args) if not GetPlayer(sender,args[1]) then chat("Server: Player does not exist") return end local player = GetPlayer(sender,args[1]) if table.find(WhitelistedPlayers,player.Name) then table.remove(WhitelistedPlayers,table.find(WhitelistedPlayers,player.Name)) chat("Server: "..player.Name.." has been removed from Whitelist") else chat("Server: "..player.Name.." is not in the Whitelist") end end Players.LocalPlayer.Chatted:Connect(function(msg) msg = string.lower(msg) local splitstring = msg:split(" ") local slashcommand if splitstring[1] == "/e" then slashcommand = splitstring[2] else slashcommand = splitstring[1] end local cmd = slashcommand:split(prefix) local cmdname = cmd[2] if commands[cmdname] then local arguments = {} if splitstring[1] == "/e" then for i = 3, #splitstring, 1 do table.insert(arguments,splitstring[i]) end else for i = 2, #splitstring, 1 do table.insert(arguments,splitstring[i]) end end commands[cmdname](Players.LocalPlayer,arguments) end end) ScreenGui2.CommandBar.FocusLost:Connect(function() local msg = ScreenGui2.CommandBar.Text msg = string.lower(msg) local splitstring = msg:split(" ") local slashcommand = splitstring[1] if commands[slashcommand] then local arguments = {} for i = 2, #splitstring, 1 do table.insert(arguments,splitstring[i]) end commands[slashcommand](Players.LocalPlayer,arguments) end end) end, }) local Button = MainTab:CreateButton({ Name = "Inf Yield", Callback = function() loadstring(game:HttpGet(('https://[Log in to view URL]'),true))() local Frame1 = Instance.new("Frame") local Frame2 = Instance.new("Frame") local Frame3 = Instance.new("Frame") Frame1.Name = "Frame1" Frame1.Parent = Holder Frame1.BackgroundColor3 = Color3.fromRGB(255, 0, 4) Frame1.BorderSizePixel = 0 Frame1.Position = UDim2.new(1, 0, -0.005, 0) Frame1.Size = UDim2.new(0.005, 0, 1.005, 0) Frame1.ZIndex = 10 Frame2.Name = "Frame2" Frame2.Parent = Holder Frame2.BackgroundColor3 = Color3.fromRGB(255, 0, 4) Frame2.BorderSizePixel = 0 Frame2.Position = UDim2.new(0, 0, -0.005, 0) Frame2.Size = UDim2.new(1, 0, 0.005, 0) Frame2.ZIndex = 10 Frame3.Name = "Frame3" Frame3.Parent = Holder Frame3.BackgroundColor3 = Color3.fromRGB(255, 0, 4) Frame3.BorderSizePixel = 0 Frame3.Position = UDim2.new(0, 0, -0.005, 0) Frame3.Size = UDim2.new(0.005, 0, 1.005, 0) Frame3.ZIndex = 10 task.spawn(function() while true do Frame1.BackgroundColor3 = Color3.new(255/255,0/255,0/255) Frame2.BackgroundColor3 = Color3.new(255/255,0/255,0/255) Frame3.BackgroundColor3 = Color3.new(255/255,0/255,0/255) for i = 0,255,10 do wait() Frame1.BackgroundColor3 = Color3.new(255/255,i/255,0/255) Frame2.BackgroundColor3 = Color3.new(255/255,i/255,0/255) Frame3.BackgroundColor3 = Color3.new(255/255,i/255,0/255) end for i = 255,0,-10 do wait() Frame1.BackgroundColor3 = Color3.new(i/255,255/255,0/255) Frame2.BackgroundColor3 = Color3.new(i/255,255/255,0/255) Frame3.BackgroundColor3 = Color3.new(i/255,255/255,0/255) end for i = 0,255,10 do wait() Frame1.BackgroundColor3 = Color3.new(0/255,255/255,i/255) Frame2.BackgroundColor3 = Color3.new(0/255,255/255,i/255) Frame3.BackgroundColor3 = Color3.new(0/255,255/255,i/255) end for i = 255,0,-10 do wait() Frame1.BackgroundColor3 = Color3.new(0/255,i/255,255/255) Frame2.BackgroundColor3 = Color3.new(0/255,i/255,255/255) Frame3.BackgroundColor3 = Color3.new(0/255,i/255,255/255) end for i = 0,255,10 do wait() Frame1.BackgroundColor3 = Color3.new(i/255,0/255,255/255) Frame2.BackgroundColor3 = Color3.new(i/255,0/255,255/255) Frame3.BackgroundColor3 = Color3.new(i/255,0/255,255/255) end for i = 255,0,-10 do wait() Frame1.BackgroundColor3 = Color3.new(255/255,0/255,i/255) Frame2.BackgroundColor3 = Color3.new(255/255,0/255,i/255) Frame3.BackgroundColor3 = Color3.new(255/255,0/255,i/255) end end end) end, }) local Button = MainTab:CreateButton({ Name = "Negative Nin", Callback = function() local rs = game:GetService("ReplicatedStorage") while wait(0.72) do rs.RemoteEvent.AddPowerEvent:FireServer("FromTraining", -2000000000000000000000000000000000000000000000000) wait(0.72) rs.RemoteEvent.AddPowerEvent:FireServer("FromTraining", -19916241294912496129491248999999.99) end end, }) local Button = MainTab:CreateButton({ Name = "Auto Equip Training Sword", Callback = function() _G.AutoEquip = true local Players = game:GetService("Players") task.spawn(function() while _G.AutoEquip do if Players.LocalPlayer.Character then if not Players.LocalPlayer.Character:FindFirstChild("Train") then if Players.LocalPlayer.Backpack:FindFirstChild("Train") then Players.LocalPlayer.Backpack:FindFirstChild("Train").Parent = Players.LocalPlayer.Character end end end task.wait() end end) end, }) local Button = MainTab:CreateButton({ Name = "Unequip Training Sword", Callback = function() _G.AutoEquip = false end, }) local Button = MainTab:CreateButton({ Name = "Rainbow Shuriken", Callback = function() game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent"):WaitForChild("GiveItemEvent"):FireServer("RainbowPass","MetallicThrowingKnives") end, }) local Button = MiscTab:CreateButton({ Name = "Forcefield Giver", Callback = function() local beforepos = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame local ff = game.Players.LocalPlayer.Character:FindFirstChild("ForceField") if not ff then repeat game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(70,98,-335) wait(0.1) until game.Players.LocalPlayer.Character:FindFirstChild("ForceField") else return end game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = beforepos end, }) local Button = TeleportTab:CreateButton({ Name = "Teleport To Spawn", Callback = function() local pos = Vector3.new(70,98,-335) game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart").CFrame = CFrame.new(pos) end, }) local Button = MiscTab:CreateButton({ Name = "Rejoin Game", Callback = function() local ts = game:GetService("TeleportService") local p = game:GetService("Players").LocalPlayer ts:Teleport(game.PlaceId, p) end, }) local Button = MiscTab:CreateButton({ Name = "Move With Training Sword", Callback = function() local Players = game:GetService("Players") if Players.LocalPlayer.Character then if Players.LocalPlayer.Character:FindFirstChild("Train") and Players.LocalPlayer.Character:FindFirstChild("Humanoid") then Players.LocalPlayer.Character:FindFirstChild("Humanoid"):UnequipTools() end end if Players.LocalPlayer:FindFirstChild("Backpack") and Players.LocalPlayer:FindFirstChild("Backpack"):FindFirstChild("Train") then for i,v in pairs(Players.LocalPlayer:FindFirstChild("Backpack"):FindFirstChild("Train"):GetDescendants()) do if v.Name ~= "Handle" and v.Name ~= "ValueCheck" then v:Destroy() elseif v.Name == "Handle" then v.Transparency = 1 end end end end, }) local Button = MiscTab:CreateButton({ Name = "No Fog", Callback = function() game.Lighting.FogEnd = 100000 game.Lighting.FogStart = 100000 end, }) local Button = MiscTab:CreateButton({ Name = "Instant Respawn", Callback = function() game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent"):WaitForChild("SpawnCharacterEvent"):FireServer("MainSpawn") end, }) local Button = Tab:CreateButton({ Name = "Fast Tools", Callback = function() _G.fasttools = true local lastshur = nil local Players = game:GetService("Players") while _G.fasttools do for i,v in ipairs(Players.LocalPlayer.Backpack:GetChildren()) do if v.Name == "Shuriken" then v.Parent = Players.LocalPlayer.Character end if lastshur ~= nil then lastshur.Parent = Players.LocalPlayer.Backpack lastshur = v else lastshur = v end task.wait(0.01) end task.wait() end end, })
Write, Run & Share Lua code online using OneCompiler's Lua online compiler for free. It's one of the robust, feature-rich online compilers for Lua language, running the latest Lua version 5.4. Getting started with the OneCompiler's Lua editor is easy and fast. The editor shows sample boilerplate code when you choose language as Lua and start coding.
OneCompiler's Lua online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample Lua program which takes name as input and prints hello message with your name.
name = io.read("*a")
print ("Hello ", name)
Lua is a light weight embeddable scripting language which is built on top of C. It is used in almost all kind of applications like games, web applications, mobile applications, image processing etc. It's a very powerful, fast, easy to learn, open-source scripting language.
-- global variables
a = 10
-- local variables
local x = 30
Value Type | Description |
---|---|
number | Represents numbers |
string | Represents text |
nil | Differentiates values whether it has data or not |
boolean | Value can be either true or false |
function | Represents a sub-routine |
userdata | Represents arbitary C data |
thread | Represents independent threads of execution. |
table | Can hold any value except nil |
While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.
while(condition)
do
--code
end
Repeat-Until is also used to iterate a set of statements based on a condition. It is very similar to Do-While, it is mostly used when you need to execute the statements atleast once.
repeat
--code
until( condition )
For loop is used to iterate a set of statements based on a condition.
for init,max/min value, increment
do
--code
end
Function is a sub-routine which contains set of statements. Usually functions are written when multiple calls are required to same set of statements which increase re-usuability and modularity.
optional_function_scope function function_name( argument1, argument2, argument3........, argumentn)
--code
return params with comma seperated
end