Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = game:GetService("Players").LocalPlayer;
- local function CreateGuiComponent(
- InstanceType,
- Parent,
- Size,
- Position,
- BackgroundColor,
- TextColor,
- Name,
- MiscellaneousProperties
- )
- local GuiComponent = Instance.new(InstanceType, Parent);
- GuiComponent.Name = Name;
- pcall(function()
- GuiComponent.Size = Size;
- GuiComponent.Position = Position;
- end);
- pcall(function()
- GuiComponent.BackgroundColor3 = BackgroundColor;
- GuiComponent.BorderColor3 = BackgroundColor;
- GuiComponent.BorderSizePixel = 0;
- end);
- pcall(function()
- GuiComponent.TextColor3 = TextColor;
- end);
- if MiscellaneousProperties then
- for Key, Value in next, MiscellaneousProperties do
- pcall(function()
- GuiComponent[Key] = Value;
- end);
- end;
- end;
- return GuiComponent;
- end;
- local Menu = CreateGuiComponent(
- "ScreenGui",
- Player:WaitForChild("PlayerGui"),
- nil,
- nil,
- nil,
- nil,
- "FPS Hax - Menu",
- {
- ResetOnSpawn = false;
- }
- );
- local Background = CreateGuiComponent(
- "Frame",
- Menu,
- UDim2.new(0, 200, 0, 170),
- UDim2.new(0, 5, 0, 5),
- Color3.new(1, 1, 1),
- nil,
- "Background"
- );
- local TopDividerBar = CreateGuiComponent(
- "Frame",
- Background,
- UDim2.new(1, 0, 0, 2),
- UDim2.new(0, 0, 0, 30),
- Color3.new(0, 0, 0),
- nil,
- "TopDividerBar"
- );
- local TopTextLabel = CreateGuiComponent(
- "TextLabel",
- Background,
- UDim2.new(1, 0, 0, 30),
- UDim2.new(0, 0, 0, 0),
- Color3.new(1, 1, 1),
- Color3.new(0, 0, 0),
- "TopTextLabel",
- {
- Text = "FPS Hax v2.1";
- Font = Enum.Font.SourceSansBold;
- FontSize = Enum.FontSize.Size24;
- }
- );
- local BottomDividerBar = CreateGuiComponent(
- "Frame",
- Background,
- UDim2.new(1, 0, 0, 2),
- UDim2.new(0, 0, 1, -32),
- Color3.new(0, 0, 0),
- nil,
- "BottomDividerBar"
- );
- local BottomTextLabel = CreateGuiComponent(
- "TextLabel",
- Background,
- UDim2.new(1, 0, 0, 30),
- UDim2.new(0, 0, 1, -30),
- Color3.new(1, 1, 1),
- Color3.new(0, 0, 0),
- "BottomTextLabel",
- {
- Text = "Created by MedievalBeast4@V3rmillion";
- Font = Enum.Font.SourceSansBold;
- TextSize = 13;
- }
- );
- local LeftDividerBar = CreateGuiComponent(
- "Frame",
- Background,
- UDim2.new(0, 3, 1, -60),
- UDim2.new(0, 13, 0, 30),
- Color3.new(0, 0, 0),
- nil,
- "LeftDividerBar"
- );
- local Features = {};
- local function CycleStatus(Feature, CycleBackwards)
- local NewStatusInteger;
- if (not CycleBackwards) then
- if (Feature[3] == #Feature[1]) then
- NewStatusInteger = 1;
- else
- NewStatusInteger = (Feature[3] + 1);
- end;
- elseif CycleBackwards then
- if (Feature[3] == #Feature[1]) then
- NewStatusInteger = (#Feature[1] - 1);
- else
- NewStatusInteger = (Feature[3] - 1);
- if (NewStatusInteger < 1) then
- NewStatusInteger = #Feature[1];
- end;
- end;
- end;
- Feature[2] = Feature[1][NewStatusInteger];
- Feature[3] = NewStatusInteger;
- end;
- local ChamsPointers = {};
- local OldTransparencies = {};
- local function SetBrickTransparencies(Model, GetTransparencyCallback)
- for Key, Value in next, Model:GetChildren() do
- if Value:IsA("BasePart") then
- if (OldTransparencies[Value] == nil) then
- OldTransparencies[Value] = Value.Transparency;
- end;
- Value.Transparency = GetTransparencyCallback(Value);
- end;
- end;
- end;
- local function DoChams(Character, Color, Transparency, ChamsType)
- for Key2, Value2 in next, Character:GetChildren() do
- if Value2:IsA("BasePart") then
- local ChamHandle = Instance.new("BoxHandleAdornment", Value2);
- ChamHandle.Name = "ChamHandle";
- ChamHandle.Transparency = Transparency;
- ChamHandle.AlwaysOnTop = true;
- ChamHandle.ZIndex = 10;
- ChamHandle.Adornee = Value2;
- ChamHandle.Transparency = Transparency;
- if (Features[ChamsType][3] == 1) then
- ChamHandle.Transparency = 1;
- SetBrickTransparencies(Character, function()
- return (0);
- end);
- if (Value2.Name == "Head") then
- Value2:FindFirstChildOfClass("Decal").Transparency = 0;
- end;
- else
- if (Value2.Name == "Head") then
- Value2:FindFirstChildOfClass("Decal").Transparency = 1;
- end;
- end;
- ChamHandle.Size = (Vector3.new(0.05, 0.05, 0.05) + Value2.Size);
- if (Value2.Name == "Head") then
- ChamHandle.Size = Vector3.new(1.25, 1.3, 1.25);
- end;
- ChamHandle.Visible = true;
- ChamHandle.Color3 = Color;
- ChamsPointers[#ChamsPointers + 1] = ChamHandle;
- end;
- end;
- end;
- local function RenderChams()
- for Key, Value in next, ChamsPointers do
- Value:Destroy();
- end;
- local function GetChamsColor(OtherPlayer, ChamsType)
- local Colors = {
- ["Off"] = Color3.new(0, 0, 0);
- ["White"] = Color3.new(1, 1, 1);
- ["Black"] = Color3.new(0, 0, 0);
- ["Red"] = Color3.new(1, 0, 0);
- ["Green"] = Color3.new(0, 1, 0);
- ["Blue"] = Color3.new(0, 0, 1);
- ["Purple"] = Color3.new(0.65, 0, 0.65);
- ["Yellow"] = Color3.new(1, 1, 0);
- ["Grey"] = Color3.new(0.8, 0.8, 0.8);
- };
- if (ChamsType == "EC") then
- return Colors[Features["Enemy Chams"][1][Features["Enemy Chams"][3]]];
- elseif (ChamsType == "TC") then
- return Colors[Features["Team Chams"][1][Features["Team Chams"][3]]];
- end;
- end;
- local function GetChamsTransparency(ChamsType)
- local Transparencies = {
- ["Off"] = 0;
- ["10%"] = 0.1;
- ["20%"] = 0.2;
- ["30%"] = 0.3;
- ["40%"] = 0.4;
- ["50%"] = 0.5;
- ["60%"] = 0.6;
- ["70%"] = 0.7;
- ["80%"] = 0.8;
- ["90%"] = 0.9;
- };
- local ChamsOff = (
- (
- (
- Features[ChamsType][2][Features[ChamsType][3]] == "Off")
- and true
- ) or nil
- );
- if ChamsOff then
- return (1);
- else
- return Transparencies[
- Features["Chams Transparency"][1][Features["Chams Transparency"][3]]
- ];
- end;
- end;
- for Key, Value in next, game:GetService("Players"):GetPlayers() do
- local Character = Value.Character;
- if (Character and (Value ~= Player)) then
- if (
- (Value.TeamColor == Player.TeamColor) and
- (Features["Team Chams"][2][Features["Team Chams"][3]] ~= "Off")
- ) then
- if (Features["Team Chams"][2][Features["Team Chams"][3]] ~= "Off") then
- DoChams(
- Character,
- GetChamsColor(Value, "TC"),
- GetChamsTransparency("Team Chams"),
- "Team Chams"
- );
- SetBrickTransparencies(Character, function()
- if (Features["Team Chams"][3] == 1) then
- return (0);
- end;
- return (1);
- end);
- else
- SetBrickTransparencies(Character, function(Brick)
- return OldTransparencies[Brick]
- end);
- end;
- elseif (
- (Value.TeamColor ~= Player.TeamColor) and
- (Features["Enemy Chams"][2][Features["Enemy Chams"][3]] ~= "Off")
- ) then
- if (
- Features["Enemy Chams"][2][Features["Enemy Chams"][3]] ~= "Off"
- ) then
- DoChams(
- Character,
- GetChamsColor(Value, "EC"),
- GetChamsTransparency("Enemy Chams"),
- "Enemy Chams"
- );
- SetBrickTransparencies(Character, function()
- return (1);
- end);
- else
- SetBrickTransparencies(Character, function(Brick)
- return OldTransparencies[Brick]
- end);
- end;
- end;
- end;
- end;
- end;
- local Rendering;
- local DefaultAmbience = {
- Color3.new(0.7, 0.7, 0.7);
- Color3.new(0.7, 0.7, 0.7);
- };
- local DefaultFog;
- local DefaultBrightness;
- local function AttemptSaveDefaultLightingSettings()
- if (DefaultAmbience[1] == Color3.new(0.7, 0.7, 0.7)) then
- DefaultFog = game:GetService("Lighting").FogEnd;
- DefaultBrightness = game:GetService("Lighting").Brightness;
- DefaultAmbience = {
- game:GetService("Lighting").Ambient;
- game:GetService("Lighting").OutdoorAmbient;
- };
- end;
- end;
- local function ChangeFullbrightCallback(Property, OptionalSetting)
- local CurrentFBSetting = (
- Features["Fullbright"][1][Features["Fullbright"][3]]
- );
- if (CurrentFBSetting == "Half") then
- if (Property == "Ambience") then
- return Color3.new(0.55, 0.55, 0.55);
- elseif (Property == "Brightness") then
- return (1.5);
- elseif (Property == "Fog") then
- return (250);
- end;
- elseif (CurrentFBSetting == "Maximum") then
- if (Property == "Ambience") then
- return Color3.new(1, 1, 1);
- elseif (Property == "Brightness") then
- return (10);
- elseif (Property == "Fog") then
- return (1000000);
- end;
- else
- if (Property == "Ambience") then
- return DefaultAmbience[OptionalSetting];
- elseif (Property == "Brightness") then
- return DefaultBrightness;
- elseif (Property == "Fog") then
- return DefaultFog;
- end;
- end;
- local Lighting = game:GetService("Lighting");
- Lighting.Ambient = ChangeFullbrightCallback("Ambience", 1);
- Lighting.OutdoorAmbient = ChangeFullbrightCallback("Ambience", 2);
- Lighting.Brightness = ChangeFullbrightCallback("Brightness");
- Lighting.FogStart = ChangeFullbrightCallback("Fog");
- Lighting.FogEnd = ChangeFullbrightCallback("Fog");
- end;
- function RenderFeatures()
- repeat
- wait();
- until (not Rendering);
- Rendering = true;
- local function GetFeaturePosition(FeatureName)
- local Pointers = {
- ["Menu hot-key"] = 1;
- ["Team Chams"] = 2;
- ["Enemy Chams"] = 3;
- ["Chams Transparency"] = 4;
- ["Fullbright"] = 5;
- };
- local IterationCount = (Pointers[FeatureName] - 1);
- return ((IterationCount * 20) + 40);
- end;
- for Key, Value in next, Background:GetChildren() do
- if Value.Name:find("_F") then
- Value:Destroy();
- end;
- end;
- local IterationCount = 0;
- for Key, Value in next, Features do
- local Feature = CreateGuiComponent(
- "Frame",
- Background,
- UDim2.new(1, 0, 25, 0),
- UDim2.new(0, 0, 0, GetFeaturePosition(Key)),
- Color3.new(0, 0, 0),
- nil,
- (Key.."_F"),
- {
- BackgroundTransparency = 1;
- }
- );
- local FeatureName = CreateGuiComponent(
- "TextLabel",
- Feature,
- UDim2.new(0.9, 0, 0, 25),
- UDim2.new(0.1, 0, 0, -3),
- Color3.new(0, 0, 0),
- Color3.new(0, 0, 0),
- "FeatureName",
- {
- BackgroundTransparency = 1;
- Text = Key;
- Font = Enum.Font.SourceSansBold;
- TextSize = 15;
- TextXAlignment = Enum.TextXAlignment.Left;
- TextYAlignment = Enum.TextYAlignment.Top;
- }
- );
- local Text;
- if (Value[2] ~= "Off") then
- Text = ("["..Value[2].."]".." ");
- else
- Text = "Off ";
- end;
- local FeatureButton = CreateGuiComponent(
- "TextButton",
- Feature,
- UDim2.new(0.9, 0, 0, 25),
- UDim2.new(0.1, 0, 0, -3),
- Color3.new(0, 0, 0),
- Color3.new(0, 0, 0),
- "FeatureStatus",
- {
- BackgroundTransparency = 1;
- Text = Text;
- Font = Enum.Font.SourceSansBold;
- TextSize = 15;
- TextXAlignment = Enum.TextXAlignment.Right;
- TextYAlignment = Enum.TextYAlignment.Top;
- AutoButtonColor = false;
- }
- );
- FeatureButton.MouseButton1Click:Connect(function()
- CycleStatus(Value);
- RenderFeatures();
- if Key:find("Chams") then
- RenderChams();
- elseif (Key == "Fullbright") then
- AttemptSaveDefaultLightingSettings();
- ChangeFullbrightCallback();
- end;
- end);
- FeatureButton.MouseButton2Click:Connect(function()
- CycleStatus(Value, true);
- RenderFeatures();
- if Key:find("Chams") then
- RenderChams();
- elseif (Key == "Fullbright") then
- AttemptSaveDefaultLightingSettings();
- ChangeFullbrightCallback();
- end;
- end);
- local StatusSymbol = CreateGuiComponent(
- "Frame",
- Feature,
- UDim2.new(0, 7, 0, 7),
- UDim2.new(0, 2, 0, 3),
- Color3.new(
- (((Value[2] == "Off") and 1) or 0),
- (((Value[2] ~= "Off") and 1) or 0),
- 0
- ),
- nil,
- "StatusSymbol"
- );
- IterationCount = (IterationCount + 1);
- end;
- Rendering = false;
- end;
- local function CreateFeature(Name, Statuses)
- Features[Name] = {
- Statuses,
- Statuses[1],
- 1
- };
- RenderFeatures();
- end;
- CreateFeature(
- "Menu hot-key",
- {
- "Delete";
- "Insert";
- }
- );
- CreateFeature(
- "Team Chams",
- {
- "Off";
- "White";
- "Black";
- "Red";
- "Green";
- "Blue";
- "Purple";
- "Yellow";
- "Grey";
- }
- );
- CreateFeature(
- "Enemy Chams",
- {
- "Off";
- "White";
- "Black";
- "Red";
- "Green";
- "Blue";
- "Purple";
- "Yellow";
- "Grey";
- }
- );
- CreateFeature(
- "Chams Transparency",
- {
- "Off";
- "10%";
- "20%";
- "30%";
- "40%";
- "50%";
- "60%";
- "70%";
- "80%";
- "90%";
- }
- );
- CreateFeature(
- "Fullbright",
- {
- "Off";
- "Half";
- "Maximum";
- }
- );
- game:GetService("UserInputService").InputBegan:Connect(function(InputObject, GameProcessedEvent)
- if (
- (not GameProcessedEvent) and
- (InputObject.UserInputType == Enum.UserInputType.Keyboard)
- ) then
- local MenuHotkeyFeature = Features["Menu hot-key"];
- if (InputObject.KeyCode == Enum.KeyCode.P) then
- RenderChams();
- AttemptSaveDefaultLightingSettings();
- ChangeFullbrightCallback();
- RenderFeatures();
- elseif (InputObject.KeyCode == Enum.KeyCode[MenuHotkeyFeature[1][MenuHotkeyFeature[3]]]) then
- Background.Visible = (not Background.Visible);
- local PreviousParent = Background.Parent;
- Background.Parent = nil;
- Background.Parent = PreviousParent;
- end;
- end;
- end);
- while true do
- RenderChams();
- AttemptSaveDefaultLightingSettings();
- ChangeFullbrightCallback();
- RenderFeatures();
- wait(15);
- end;
Add Comment
Please, Sign In to add comment