Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago

its:

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

h.WalkSpeed.Value = h.WalkSpeed.Value + 1
0
or alternatively use the '+=' operator Vinceberget 1420 — 3y
Ad

Answer this question