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

How to make a script with a adding value of +1 rather than just simply 1?

Hello! I am currently working on a script that will make you gain WalkSpeed each time you walk, i am just getting started with scripting so please dont take advantage of my scripting level, i have trying to modify a script that i found on the Developer form however it shows an error where it says "+1"

local player = game.Players.LocalPlayer
local char = player.CharacterAdded:wait()
local h = char.Humanoid

h.WalkSpeed.Value = +1

The reason i wanted to do +1 is because that if i just do 1, i already know that it will just stay as 1 rather than just adding 1 to the Player's WalkSpeed. I would like to know if there is anyway to write this script in another format or in a working format.. Thanks for all the care!

1 answer

✓ Accepted answer

its:

local player = game.Players.LocalPlayer
local char = player.CharacterAdded:wait()
local h = char.Humanoid

h.WalkSpeed.Value = h.WalkSpeed.Value + 1

1 comment

0

or alternatively use the '+=' operator

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