Hey, im making a treadmill.
And this is the Code
local deb= false
local conveyer= script.Parent
local stats= game.ServerStorage.PlrFolder
local i= 0
local update= game.ReplicatedStorage.updateStats
script.Parent.Touched:Connect(function(hit)
if deb == false then deb=true
if hit.Parent:FindFirstChild("Humanoid") then
local plr= game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
local pf= stats[plr.Name]
local speed= pf.Speed
do
for _,v in pairs(script.Parent.Parent.active:GetChildren()) do
v.BrickColor= BrickColor.new("Lime green")
end
end
while (hit.Position - conveyer.Position).magnitude < 10 and hit.Parent.Humanoid.MoveDirection ~= Vector3.new(0,0,0) do
i=i+1
if i == 500 and speed < 40 then
speed = speed+1
i=0
end
wait()
end
do
for _,v in pairs(script.Parent.Parent.active:GetChildren()) do
v.BrickColor= BrickColor.new("Bright blue")
end
end
i=0
end
end
deb=false
end
end)
But the walk speed does not increase:
if i == 500 and speed < 40 then
speed = speed+1
I tried placing the = and the + on other spots like this.
if i == 500 and speed < 40 then
speed = speed + 1
But as you already knew i did not work OOF So you guys know how to do this?
Treadmill: https://www.roblox.com/catalog/03133642024/redirect
Oh and the output says nothing

2 comments
I'm curious to know how you are storing the player names and why just not use "game.Players:GetPlayers()[plr.Name]"?
Becasue my friend helped me make this and i know a little of scripting