You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
Im making speed simulator and when you walk your speed gets 0.1 more
What is the issue? Include screenshots / videos if possible!
when defining it it wont change even though it passes all checks
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
yes i tried but didnt find why this wouldnt work
Server Script
while task.wait() do
for _, v in next, game:GetService("Players"):GetPlayers() do
if v:FindFirstChild("leaderstats") and v.leaderstats:FindFirstChild("Speed") and v.Character then
local hum = v.Character:FindFirstChildOfClass("Humanoid")
if hum and hum.MoveDirection ~= Vector3.new(0, 0, 0) then
v.leaderstats.Speed.Value += 0.1
end
end
end
end
while task.wait() do
for _, v in ipairs(game:GetService("Players"):GetPlayers()) do
if v:FindFirstChild("leaderstats") and v.leaderstats:FindFirstChild("Speed") and v.Character then
local hum = v.Character:FindFirstChildOfClass("Humanoid")
if hum and hum.MoveDirection ~= Vector3.new(0, 0, 0) then
v.leaderstats.Speed.Value += 0.1
end
end
end
end
IntValues only work with integers (whole numbers). They automatically round up or down when given a decimal. Change it to a NumberValue instead. NumberValues will take numbers with decimals.