So i'm trying to make a script that when you walk it adds a point but I want it to make me fast and make multiplier that when you walk faster from enough speed it multiples it. |What I did for what I think would work|
wait(4)
while wait(.5) do
local children = game.Players:GetChildren()
for i = 1, #children do
if children[i].Character ~= nil then
local hum = children[i].Character.Humanoid
hum.WalkSpeed = children[i].leaderstats.Speed.Value/10 + 1
if game.Players.LocalPlayer.Character.Humanoid.MoveDirection.Magnitude > 0 then
workspace.Events.AddSpeed:FireServer()
end
end
|Leaderstats that work|
game.Players.PlayerAdded:connect(function(player)
local key = "codes-"..player.userId
local leaderstats = Instance.new("Model")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local money = Instance.new("IntValue")
money.Name = "Speed"
money.Value = 0
money.Parent = leaderstats
local money = Instance.new("IntValue")
money.Name = "AllSpeed"
money.Value = 0
money.Parent = leaderstats
local money = Instance.new("IntValue")
money.Name = "Coins"
money.Value = 0
money.Parent = leaderstats
local money = Instance.new("IntValue")
money.Name = "Rebirths"
money.Value = 0
money.Parent = leaderstats
end)
