Last active
August 19, 2022 22:35
-
-
Save CyclicaIIy/9abbaa49000fd8ec6c5b67becf7e3ce7 to your computer and use it in GitHub Desktop.
Elemental Battlegrounds GUI which features Auto Aim, Unlimited Stamina, Visuals, etc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Elementalist by @cyclically | |
-- for Elemental Battlegrounds | |
-- loadstring(game:HttpGet("https://gist.github.com/CyclicaIIy/9abbaa49000fd8ec6c5b67becf7e3ce7/raw/"))() | |
-- making new configs may not update the dropdowns because this UI library is retarded, it's too late to switch libaries | |
-- this script was originally made for my own personal use, just decided to release it to the public | |
local Players = game:GetService("Players") | |
local HttpService = game:GetService("HttpService") | |
local StarterGui = game:GetService("StarterGui") | |
local RunService = game:GetService("RunService") | |
local TeleportService = game:GetService("TeleportService") | |
local Lighting = game:GetService("Lighting") | |
local LocalPlayer = Players.LocalPlayer | |
local Camera = workspace.CurrentCamera | |
local Mouse = LocalPlayer:GetMouse() | |
local SkillsBar = LocalPlayer.PlayerGui.Main.SkillsBar | |
local NearestPlayer = nil | |
local isAimbotting = false | |
local isCircle = true | |
local isLocked = false | |
local function getFiles(list) | |
local newList = {} | |
for _, name in pairs(list) do | |
table.insert(newList, string.split(string.gsub(name, "^Elementalist\\", ""), ".")[1]) | |
end | |
return newList | |
end | |
local config = { -- default config | |
["VERSION"] = 0.2, | |
["VISIBILITY_KEYBIND"] = Enum.KeyCode.Delete, | |
["AIMLOCK_KEYBIND"] = Enum.KeyCode.Q, | |
["LOCKED_CIRCLE"] = Color3.new(1, 0, 0), | |
["AIMBOT_KEYBIND"] = Enum.KeyCode.E, | |
["UNACTIVATED_CIRCLE"] = Color3.new(0, 0, 0), | |
["UNLOCKED_CIRCLE"] = Color3.new(1, 1, 1), | |
["MAX_DISTANCE"] = 1250, | |
["PREDICTION_DAMPENING"] = 6, | |
["IGNORE_FORCEFIELD"] = true, | |
["CIRCLE_THICKNESS"] = 1, | |
["CIRCLE_RADIUS"] = 10, | |
["STAMINA_ACTIVATED"] = false, | |
["STAMINA_SPEED"] = 50, | |
["HEIGHT_DISTANCE"] = 30, | |
["GROUND_1"] = false, | |
["GROUND_2"] = false, | |
["GROUND_3"] = false, | |
["GROUND_4"] = false, | |
["GROUND 5"] = false, | |
["FOV"] = 70, | |
["SHADOWS"] = true, | |
["THEMES"] = { | |
Background = Color3.fromRGB(24, 24, 24), | |
Glow = Color3.fromRGB(0, 0, 0), | |
Accent = Color3.fromRGB(10, 10, 10), | |
LightContrast = Color3.fromRGB(20, 20, 20), | |
DarkContrast = Color3.fromRGB(14, 14, 14), | |
TextColor = Color3.fromRGB(255, 255, 255), | |
} | |
} | |
local EncodeConfig | |
EncodeConfig = function(data) | |
local encodedConfig = {} | |
for name, value in pairs(data) do | |
if typeof(value) == "EnumItem" then | |
encodedConfig[name] = {"KeyCode", string.split(tostring(value), ".")[3]} | |
elseif typeof(value) == "Color3" then | |
encodedConfig[name] = {"Color", string.gsub(tostring(value), "%s" , "")} | |
elseif type(value) == "table" then | |
encodedConfig[name] = EncodeConfig(value) | |
else | |
encodedConfig[name] = value | |
end | |
end | |
return encodedConfig | |
end | |
local DecodeConfig | |
DecodeConfig = function(data, t) | |
local decodedConfig = {} | |
for name, value in pairs(data) do | |
if t[name] ~= nil then | |
if type(value) == "table" then | |
if value[1] == "KeyCode" then | |
decodedConfig[name] = Enum.KeyCode[value[2]] | |
elseif value[1] == "Color" then | |
decodedConfig[name] = Color3.new(unpack(string.split(value[2], ","))) | |
else | |
decodedConfig[name] = DecodeConfig(value, t[name]) | |
end | |
else | |
decodedConfig[name] = value | |
end | |
end | |
end | |
for name, value in pairs(t) do -- automatically update outdated configs | |
if decodedConfig[name] == nil then | |
decodedConfig[name] = value | |
end | |
end | |
return decodedConfig | |
end | |
makefolder("Elementalist") | |
if isfile("Elementalist/default.cfg") then | |
config = DecodeConfig(HttpService:JSONDecode(readfile("Elementalist/default.cfg")), config) | |
else | |
writefile("Elementalist/default.cfg", HttpService:JSONEncode(EncodeConfig(config))) | |
end | |
Camera.FieldOfView = config.FOV | |
Lighting.GlobalShadows = config.SHADOWS | |
local TargetCircle = Drawing.new("Circle") | |
TargetCircle.Filled = false | |
TargetCircle.Thickness = config.CIRCLE_THICKNESS | |
TargetCircle.Radius = config.CIRCLE_RADIUS | |
local UILibrary = loadstring(game:HttpGet("https://raw.githubusercontent.com/GreenDeno/Venyx-UI-Library/main/source.lua"))() | |
local Elementalist = UILibrary.new("Elementalist (by @cyclically)") | |
local SettingsPage = Elementalist:addPage("Settings", 5012544693) | |
local LegitPage = Elementalist:addPage("Legit") | |
local AimbotSection = LegitPage:addSection("Auto Aim") | |
local LockSection = LegitPage:addSection("Lock Target") | |
local HeartbeatEvent | |
local function ToggleNearest() | |
if isAimbotting or isCircle or config.STAMINA_ACTIVATED then | |
if not HeartbeatEvent or not HeartbeatEvent.Connected then | |
HeartbeatEvent = RunService.Heartbeat:Connect(function() | |
if isAimbotting or isCircle then | |
if isLocked and (not NearestPlayer or not NearestPlayer.Character or not NearestPlayer.Character:FindFirstChild("Humanoid") or NearestPlayer.Character.Humanoid:GetState() == Enum.HumanoidStateType.Dead) then | |
isLocked = false | |
if LockSection.updateToggle then | |
LockSection:updateToggle(LockToggle, "Activated", isLocked) | |
end | |
elseif not isLocked then | |
NearestPlayer = nil | |
local NearestValue = math.huge | |
for _, Player in pairs(Players:GetPlayers()) do | |
if LocalPlayer ~= Player and LocalPlayer.Character and Player.Character and (config.IGNORE_FORCEFIELD and not Player.Character:FindFirstChildOfClass("ForceField")) then | |
local HumanoidRootPart, Humanoid = Player.Character:FindFirstChild("HumanoidRootPart"), Player.Character:FindFirstChild("Humanoid") | |
if HumanoidRootPart and Humanoid and Humanoid:GetState() ~= Enum.HumanoidStateType.Dead then | |
local Distance = LocalPlayer:DistanceFromCharacter(HumanoidRootPart.Position) | |
if Distance < config.MAX_DISTANCE and Distance < NearestValue then | |
NearestValue = Distance | |
NearestPlayer = Player | |
end | |
end | |
end | |
end | |
end | |
if isCircle and NearestPlayer then | |
if isAimbotting then | |
if isLocked then | |
TargetCircle.Color = config.LOCKED_CIRCLE | |
else | |
TargetCircle.Color = config.UNLOCKED_CIRCLE | |
end | |
else | |
TargetCircle.Color = config.UNACTIVATED_CIRCLE | |
end | |
TargetCircle.Visible = true | |
local ScreenPosition = Camera:WorldToViewportPoint(NearestPlayer.Character.HumanoidRootPart.Position) | |
TargetCircle.Position = Vector2.new(ScreenPosition.X, ScreenPosition.Y) | |
else | |
TargetCircle.Visible = false | |
end | |
end | |
if config.STAMINA_ACTIVATED and LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("Humanoid") then | |
LocalPlayer.Character.Humanoid.WalkSpeed = config.STAMINA_SPEED | |
end | |
end) | |
end | |
elseif HeartbeatEvent and HeartbeatEvent.Connected then | |
HeartbeatEvent:Disconnect() | |
end | |
end | |
ToggleNearest() | |
local GroundParams = RaycastParams.new() | |
GroundParams.IgnoreWater = true | |
local OldIndex = nil | |
local OldNewIndex = nil | |
OldIndex = hookmetamethod(game, "__index", function(Self, Key) | |
if not checkcaller() and isAimbotting and NearestPlayer and Self == Mouse then | |
local NearestHumanoidRootPart = NearestPlayer.Character:FindFirstChild("HumanoidRootPart") | |
if NearestHumanoidRootPart then | |
if Key == "Hit" then | |
if (config.GROUND_1 and SkillsBar["1"].BorderSizePixel > 0) or (config.GROUND_2 and SkillsBar["2"].BorderSizePixel > 0) or (config.GROUND_3 and SkillsBar["3"].BorderSizePixel > 0) or (config.GROUND_4 and SkillsBar["4"].BorderSizePixel > 0) or (config.GROUND_5 and SkillsBar["5"].BorderSizePixel > 0) then | |
GroundParams.FilterDescendantsInstances = {NearestPlayer.Character, workspace[".Ignore"]} | |
local GroundResult = workspace:Raycast(NearestHumanoidRootPart.Position, Vector3.new(0, -20, 0), GroundParams) | |
if GroundResult then | |
return CFrame.new(GroundResult.Position, GroundResult.Position + GroundResult.Normal) | |
end | |
end | |
return NearestHumanoidRootPart.CFrame + (Vector3.new(NearestHumanoidRootPart.Velocity.X, 0, NearestHumanoidRootPart.Velocity.Z) / config.PREDICTION_DAMPENING) | |
elseif Key == "Target" then | |
return NearestHumanoidRootPart | |
end | |
end | |
end | |
return OldIndex(Self, Key) | |
end) | |
OldNewIndex = hookmetamethod(game, "__newindex", function(Table, Index, Value) | |
if not checkcaller() then | |
if Table.Parent == LocalPlayer.Character and Index == "WalkSpeed" and config.STAMINA_ACTIVATED then | |
return | |
end | |
end | |
return OldNewIndex(Table, Index, Value) | |
end) | |
local ConfigSection = SettingsPage:addSection("Configuration") | |
local UISection = SettingsPage:addSection("User Interface") | |
local VisibilityKeybind = UISection:addKeybind("Visibility", config.VISIBILITY_KEYBIND, function() | |
Elementalist:toggle() | |
end, function(keybind) | |
config.VISIBILITY_KEYBIND = keybind | |
end) | |
local ColorpickerList = {} | |
for Theme, ThemeType in pairs(config.THEMES) do | |
ColorpickerList[Theme] = UISection:addColorPicker(Theme, ThemeType, function(Color) | |
Elementalist:setTheme(Theme, Color) | |
config.THEMES[Theme] = color | |
end) | |
end | |
local AimbotToggle = AimbotSection:addToggle("Activated", isAimbotting, function(value) | |
isAimbotting = value | |
ToggleNearest() | |
end) | |
local AimbotKeybind = AimbotSection:addKeybind("Keybind", config.AIMBOT_KEYBIND, function() | |
isAimbotting = not isAimbotting | |
AimbotSection:updateToggle(AimbotToggle, "Activated", isAimbotting) | |
ToggleNearest() | |
end, function(keybind) | |
config.AIMBOT_KEYBIND = keybind | |
end) | |
local ForceFieldToggle = AimbotSection:addToggle("Ignore Forcefield", config.IGNORE_FORCEFIELD, function(value) | |
config.IGNORE_FORCEFIELD = value | |
end) | |
local DampeningSlider = AimbotSection:addSlider("Prediction Dampening", config.PREDICTION_DAMPENING, 1, 10, function(dampening) | |
config.PREDICTION_DAMPENING = dampening | |
end) | |
local DistanceSlider = AimbotSection:addSlider("Max Distance", config.MAX_DISTANCE, 500, 2000, function(distance) | |
config.MAX_DISTANCE = distance | |
end) | |
local LockToggle = LockSection:addToggle("Activated", isLocked, function(value) | |
isLocked = value | |
end) | |
local LockKeybind = LockSection:addKeybind("Keybind", config.AIMLOCK_KEYBIND, function() | |
isLocked = not isLocked | |
LockSection:updateToggle(LockToggle, "Activated", isLocked) | |
end, function(keybind) | |
config.AIMLOCK_KEYBIND = keybind | |
end) | |
local LockColor = LockSection:addColorPicker("Color", config.LOCKED_CIRCLE, function(color) | |
config.LOCKED_CIRCLE = color | |
end) | |
local CircleSection = LegitPage:addSection("Circle") | |
CircleSection:addToggle("Activated", isCircle, function(value) | |
TargetCircle.Visible = value | |
isCircle = value | |
ToggleNearest() | |
end) | |
local RadiusSlider = CircleSection:addSlider("Radius", config.CIRCLE_RADIUS, 5, 50, function(radius) | |
config.CIRCLE_RADIUS = radius | |
TargetCircle.Radius = radius | |
end) | |
local ThicknessSlider = CircleSection:addSlider("Thickness", config.CIRCLE_THICKNESS, 1, 10, function(thickness) | |
config.CIRCLE_THICKNESS = thickness | |
TargetCircle.Thickness = thickness | |
end) | |
local ActiveColor = CircleSection:addColorPicker("Active Color", config.UNLOCKED_CIRCLE, function(color) | |
config.UNLOCKED_CIRCLE = color | |
end) | |
local InactiveColor = CircleSection:addColorPicker("Inactive Color", config.UNACTIVATED_CIRCLE, function(color) | |
config.UNACTIVATED_CIRCLE = color | |
end) | |
local StaminaSection = LegitPage:addSection("Stamina") | |
local StaminaToggle = StaminaSection:addToggle("Activated", config.STAMINA_ACTIVATED, function(value) | |
config.STAMINA_ACTIVATED = value | |
end) | |
local StaminaSlider = StaminaSection:addSlider("Speed", config.STAMINA_SPEED, 1, 100, function(speed) | |
config.STAMINA_SPEED = speed | |
end) | |
local GroundSection = LegitPage:addSection("Ground Skills (Aims to the ground of the target instead)") | |
local Ground1 = GroundSection:addToggle("Skill 1", config.GROUND_1, function(toggled) | |
config.GROUND_1 = toggled | |
end) | |
local Ground2 = GroundSection:addToggle("Skill 2", config.GROUND_2, function(toggled) | |
config.GROUND_2 = toggled | |
end) | |
local Ground3 = GroundSection:addToggle("Skill 3", config.GROUND_3, function(toggled) | |
config.GROUND_3 = toggled | |
end) | |
local Ground4 = GroundSection:addToggle("Skill 4", config.GROUND_4, function(toggled) | |
config.GROUND_4 = toggled | |
end) | |
local Ground5 = GroundSection:addToggle("Skill 5", config.GROUND_5, function(toggled) | |
config.GROUND_5 = toggled | |
end) | |
local HeightSlider = GroundSection:addSlider("Detection Distance", config.HEIGHT_DISTANCE, 20, 50, function(distance) | |
config.HEIGHT_DISTANCE = distance | |
end) | |
local OthersPage = Elementalist:addPage("Others") | |
local ClientSection = OthersPage:addSection("Client") | |
local ShadowsToggle = ClientSection:addToggle("Global Shadows", config.SHADOWS, function(value) | |
config.SHADOWS = value | |
Lighting.GlobalShadows = value | |
end) | |
local FOVSlider = ClientSection:addSlider("Field Of View", config.FOV, 60, 120, function(value) | |
config.FOV = value | |
Camera.FieldOfView = value | |
end) | |
ClientSection:addButton("Rejoin Server", function() | |
TeleportService:TeleportToPlaceInstance(game.PlaceId, game.JobId, LocalPlayer) | |
end) | |
ClientSection:addButton("Rejoin Game", function() | |
LocalPlayer:Kick("REJOINING...") | |
TeleportService:Teleport(game.PlaceId, LocalPlayer) | |
end) | |
local configName = "default" | |
local chosenConfig = "default" | |
local ConfigDropdown = ConfigSection:addDropdown("default", getFiles(listfiles("Elementalist")), function(value) | |
chosenConfig = value | |
end) | |
ConfigSection:addTextbox("Configuration Name", "default", function(name) | |
configName = name | |
end) | |
ConfigSection:addButton("Save Configuration", function() | |
writefile(string.format("Elementalist/%s.cfg", configName), HttpService:JSONEncode(EncodeConfig(config))) | |
ConfigSection:updateDropdown(ConfigDropdown, configName, getFiles(listfiles("Elementalist")), function() | |
chosenConfig = value | |
end) | |
end) | |
ConfigSection:addButton("Load Configuration", function() | |
if chosenConfig then | |
local filePath = string.format("Elementalist/%s.cfg", chosenConfig) | |
if isfile(filePath) then | |
config = DecodeConfig(HttpService:JSONDecode(readfile(filePath)), config) | |
UISection:updateKeybind(VisibilityKeybind, "Visibility", config.VISIBILITY_KEYBIND) | |
for Theme, ThemeType in pairs(config.THEMES) do | |
UISection:updateColorPicker(ColorpickerList[Theme], Theme, ThemeType) | |
end | |
LockSection:updateKeybind(LockKeybind, "Keybind", config.AIMLOCK_KEYBIND) | |
LockSection:updateColorPicker(LockColor, "Color", config.LOCKED_CIRCLE) | |
AimbotSection:updateKeybind(AimbotKeybind, "Keybind", config.AIMBOT_KEYBIND) | |
AimbotSection:updateSlider(DampeningSlider, "Prediction Dampening", config.PREDICTION_DAMPENING, 1, 10) | |
AimbotSection:updateSlider(DistanceSlider, "Max Distance", config.MAX_DISTANCE, 500, 2000) | |
AimbotSection:updateToggle(ForceFieldToggle, "Ignore Forcefield", config.IGNORE_FORCEFIELD) | |
CircleSection:updateColorPicker(InactiveColor, "Inactive Color", config.UNACTIVATED_CIRCLE) | |
CircleSection:updateColorPicker(ActiveColor, "Active Color", config.UNLOCKED_CIRCLE) | |
CircleSection:updateSlider(RadiusSlider, "Radius", config.CIRCLE_RADIUS, 5, 50) | |
CircleSection:updateSlider(ThicknessSlider, "Thickness", config.CIRCLE_THICKNESS, 1, 10) | |
StaminaSection:updateToggle(StaminaToggle, "Activated", config.STAMINA_ACTIVATED) | |
StaminaSection:updateSlider(StaminaSlider, "Speed", config.STAMINA_SPEED, 1, 100) | |
GroundSection:updateSlider(HeightSlider, "Detection Distance", config.HEIGHT_DISTANCE, 20, 50) | |
GroundSection:updateToggle(Ground1, "Skill 1", config.GROUND_1) | |
GroundSection:updateToggle(Ground2, "Skill 2", config.GROUND_2) | |
GroundSection:updateToggle(Ground3, "Skill 3", config.GROUND_3) | |
GroundSection:updateToggle(Ground4, "Skill 4", config.GROUND_4) | |
GroundSection:updateToggle(Ground5, "Skill 5", config.GROUND_5) | |
ClientSection:updateSlider(FOVSlider, "Field Of View", config.FOV, 60, 120) | |
ClientSection:updateToggle(ShadowsToggle, "Global Shadows", config.SHADOWS) | |
end | |
end | |
end) | |
ConfigSection:addButton("Delete Configuration", function() | |
if chosenConfig then | |
local filePath = string.format("Elementalist/%s.cfg", chosenConfig) | |
if isfile(filePath) then | |
Elementalist:Notify("Delete", "Cancel", function(callback) | |
if callback then | |
delfile(filePath) | |
end | |
end) | |
end | |
end | |
end) | |
Elementalist:SelectPage(Elementalist.pages[1], true) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment