Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local TweenService = game:GetService("TweenService")
- local Player = game.Players.LocalPlayer
- local PlayerGui = Player:WaitForChild("PlayerGui")
- local Character = Player.Character or Player.CharacterAdded:Wait()
- local Humanoid = Character:WaitForChild("Humanoid");
- local MainFrame = PlayerGui.StatGUI.MainFrame
- local statFolder = Player:WaitForChild("statFolder")
- local WhiteList = {
- "Power";
- "Health";
- "Speed";
- "StatPoints"
- }
- local function detectChange(Value: IntValue)
- MainFrame[Value.Name].Text = Value.Name..": "..Value.Value;
- end
- PlayerGui.StatGUI.MenuButton.TextButton.MouseButton1Click:Connect(function()
- MainFrame.Visible = not MainFrame.Visible;
- end)
- for i,v in pairs(statFolder:GetChildren()) do
- if not table.find(WhiteList, v.Name) then continue end
- v.Changed:Connect(function()
- if not table.find(WhiteList, v.Name) then return end
- detectChange(v)
- end)
- detectChange(v)
- end
- for _,v: ImageButton in pairs(MainFrame:GetDescendants()) do
- if not v:IsA("ImageButton") then continue end
- v.MouseButton1Click:Connect(function()
- if not ReplicatedStorage.Events.statChecker:InvokeServer(v.Parent, false) then return end
- end)
- end
- -- EXPERIENCE CHANGE --
- local EXPFrame = PlayerGui.StatGUI.ExpFrame;
- local currentEXP = statFolder.currentExp;
- local MaxEXP = statFolder.maxEXP;
- local Level = statFolder.Level;
- Level.Changed:Connect(function()
- EXPFrame[Level.Name].Text = "Level: "..Level.Value;
- local LevelEffect = ReplicatedStorage.Effects.ExpPart.LevelUp:Clone();
- LevelEffect.Parent = Player.Character:WaitForChild("HumanoidRootPart")
- LevelEffect:Emit(450)
- game.Debris:AddItem(LevelEffect, .5);
- end)
- EXPFrame[Level.Name].Text = "Level: "..Level.Value;
- statFolder.currentExp.Changed:Connect(function()
- EXPFrame.EXPtext.Text = currentEXP.Value.." / "..MaxEXP.Value;
- TweenService:Create(EXPFrame.Frame, TweenInfo.new(.5), {Size = UDim2.new((currentEXP.Value + MaxEXP.Value/100)/MaxEXP.Value,0,1,0)}):Play()
- end)
- EXPFrame.EXPtext.Text = currentEXP.Value.." / "..MaxEXP.Value;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement