I am trying to use gamepasses to multiply the amount of points / "Steps" given to the player. How would I do this? I would like to make it so if the player has pass4, it does:
plr.leaderstats["Steps"].Value = plr.leaderstats["Steps"].Value + 4
If they have pass3, it does:
plr.leaderstats["Steps"].Value = plr.leaderstats["Steps"].Value + 3
And if they have pass2, it does
plr.leaderstats["Steps"].Value = plr.leaderstats["Steps"].Value + 2
--POINT ADDER--
local vec3 = Vector3
local pass4 = 1163402460
local pass3 = 1163401151
local pass2 = 1163394115
local function CheckForWalk(plr, hum)
pcall(function()
while wait() do
if hum.MoveDirection ~= vec3.new(0, 0, 0) then --if the character is moving
while wait(5/plr.leaderstats["Steps"].Value^(1/2)) do --while the player is moving, increase their step points each second.
if hum.MoveDirection ~= vec3.new(0, 0, 0) then
plr.leaderstats["Steps"].Value = plr.leaderstats["Steps"].Value + 1
else
break
end
end
end
end
end)
end
game.Players.PlayerAdded:connect(function(plr)--NOTE: this still breaks when "W" is held in and you die.
plr.CharacterAdded:Connect(function(char)
local hum = char:WaitForChild("Humanoid")
CheckForWalk(plr, hum)
end)
end)
Thank you for the help!

2 comments
To be honest, I think they teach multiplication before exponentiation.
I am trying to figure out how to include the gamepasses.