Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local RS = game:GetService("ReplicatedStorage")
- local ServerRemote = RS:WaitForChild("RemoteEvents"):WaitForChild("Server")
- -- || Configurations || --
- local MaxEXPPerLevel = 1.8 -- || Amount multiplied of the max exp value per level up ||
- game.Players.PlayerAdded:Connect(function(player)
- local RS = game:GetService("ReplicatedStorage")
- local Trails = RS:WaitForChild("Trails")
- local Data = Instance.new("Folder", player)
- Data.Name = "Data"
- local Level = Instance.new("IntValue", Data)
- Level.Name = "Level"
- Level.Value = 0
- local Stamina = Instance.new("IntValue", Data)
- Stamina.Name = "Stamina"
- Stamina.Value = 100
- local IsRunning = Instance.new("BoolValue", Data)
- IsRunning.Name = "IsRunning"
- IsRunning.Value = false
- IsRunning.Changed:Connect(function(value)
- spawn(function()
- while value == true do
- wait(3)
- Stamina.Value -= 10
- end
- end)
- end)
- local MaxEXP = Instance.new("IntValue", Data)
- MaxEXP.Name = "MaxEXP"
- MaxEXP.Value = 100
- local EXP = Instance.new("IntValue", Data)
- EXP.Name = "EXP"
- EXP.Value = 0
- local MaxSpeed = Instance.new("IntValue", Data)
- MaxSpeed.Name = "MaxSpeed"
- MaxSpeed.Value = 60
- MaxEXP.Changed:Connect(function(MaxEXPnum)
- if EXP >= MaxEXPnum then
- MaxEXP.Value *= MaxEXPPerLevel
- EXP.Value = 0
- end
- end)
- player.CharacterAdded:Connect(function(char)
- local HRP = char:WaitForChild("HumanoidRootPart")
- local Head = char:WaitForChild("Head")
- local Running = Instance.new("Sound", HRP)
- Running.Name = "Running"
- Running.SoundId = "rbxassetid://4738483700"
- Running.Volume = 6
- Running.Looped = true
- local StartRun = Instance.new("Sound", HRP)
- StartRun.Name = "StartRun"
- StartRun.SoundId = "rbxassetid://558640653"
- StartRun.Volume = 0.3
- StartRun.RollOffMinDistance = 20
- local AttachmentTop = Instance.new("Attachment", Head)
- AttachmentTop.Position = Vector3.new(0, 0.265, 0.515)
- local AttachmentBottom = Instance.new("Attachment", Head)
- AttachmentBottom.Position = Vector3.new(0, -2.440, 0.470)
- local Trail1Clone = Trails:WaitForChild("Orange"):Clone()
- Trail1Clone.Enabled = false
- Trail1Clone.Parent = Head
- Trail1Clone.Attachment0 = AttachmentTop
- Trail1Clone.Attachment1 = AttachmentBottom
- local Trail2Clone = Trails:WaitForChild("Yellow"):Clone()
- Trail2Clone.Enabled = false
- Trail2Clone.Parent = Head
- Trail2Clone.Attachment0 = AttachmentTop
- Trail2Clone.Attachment1 = AttachmentBottom
- end)
- end)
- ServerRemote.OnServerEvent:Connect(function(Player, task)
- local Data = Player:WaitForChild("Data")
- local Character = Player.Character or Player.CharacterAdded:Wait()
- local HRP = Character:WaitForChild("HumanoidRootPart")
- local Trail1 = Character:WaitForChild("Head"):WaitForChild("Orange")
- local Trail2 = Character:WaitForChild("Head"):WaitForChild("Yellow")
- local RunSound = HRP:WaitForChild("Running")
- local startRunSound = HRP:WaitForChild("StartRun")
- local DashEffect = RS:WaitForChild("VFX"):WaitForChild("DashEffect")
- local turnOffSpeed = coroutine.create(function()
- while wait() do
- if Data:WaitForChild("Stamina").Value < 0 then
- Data:WaitForChild("IsRunning").Value = false
- Trail1.Enabled = false
- Trail2.Enabled = false
- local FOV = game:GetService("TweenService"):Create(workspace.CurrentCamera, TweenInfo.new(0.7, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0), {FieldOfView = 70})
- FOV:Play()
- Character:WaitForChild("Humanoid").WalkSpeed = 16
- RunSound:Stop()
- end
- end
- end)
- if task == "BoostSpeed" and Data:WaitForChild("Stamina").Value < 0 then
- Data:WaitForChild("IsRunning").Value = true
- Trail1.Enabled = true
- Trail2.Enabled = true
- Character:WaitForChild("Humanoid").WalkSpeed = Data:WaitForChild("MaxSpeed").Value
- local DashClone = DashEffect:Clone()
- DashClone.Parent = workspace
- DashClone.CFrame = HRP.CFrame
- local Orientation = Player.Character.Head.Orientation.Y
- DashClone.Orientation = Vector3.new(90,Orientation,0)
- RunSound:Play()
- startRunSound:Play()
- coroutine.resume(turnOffSpeed)
- wait(0.7)
- coroutine.yield()
- elseif task == "BoostOff" then
- Data:WaitForChild("IsRunning").Value = false
- Trail1.Enabled = false
- Trail2.Enabled = false
- RunSound:Stop()
- coroutine.yield()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement