i made a script that gives the player a certain amount of walkspeed and jumppower every 3 seconds if the tool is clicked, but the result shows something else
print("loaded") debounce = false script.Parent.Activated:Connect(function() if not debounce then debounce = true if script.Parent.Parent:FindFirstChild("Humanoid") then script.Parent.Parent.Humanoid.WalkSpeed = script.Parent.Parent.Humanoid.WalkSpeed + 1/5 script.Parent.Parent.Humanoid.JumpPower = script.Parent.Parent.Humanoid.JumpPower + 1/10 wait(3) debounce = false end end end)
the result is 0.20000000298023 walkspeed and 0.10000000149012 jumppower when its supposed to just be + 0.2 walkspeed and + 0.1 jumppower. I added the / after to check if that would help but no it didnt at all
Are you sure there isn't anything else editing the walkspeed?
If that is the only thing that is editing the walkspeed it is either a glitch or something on the engine side that is doing that, the decimals you are showing are so close to the actual numbers it shouldn't make any noticeable difference if that is the case.
As far as I know, that's kinda what happens in Roblox with rounding numbers sometimes. If I were to create a new NumberValue
and set its Value
to 0.2, then it would instead be set to something like 0.2000000000000000111.