Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why does the walkspeed and jumpspeed change so weird?

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

2 answers

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.

3 comments

0

i have that value as a screengui so the player can see how much speed and jumppower they currently have since i havent successfully put in a leaderboard yet

0

and yes there is nothing else changing the walkspeed

0

Then its something engine side or a bug. Or maybe your gui is a tad messed up. @Gameplayer365247v2

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.