I want to change the Value of motorbike speed (Working for an upgrade system) but I am not able to change the value of the value inside of the bike. Does anyone see a workaround?
local players = game.Players.LocalPlayer local genUpgrade = game.Workspace.Players.Motorcycle.Value while true do genUpgrade.Value = genUpgrade.Value + 20 end
Cheers,
Michael.
Well, I can see 2 problems that poke my eye.
genUpgrade = game.Workspace.Players.Motorcycle.Value
You store the value of Motorcycle, which won't work as you will only increment the variable, not the actual property of Motorcycle. You should instead do:
genUpgrade = game.Workspace.Players.Motorcycle
Second, you should never EVER do a loop without wait's. Instead, do this: while wait() do
Hope this helped.
local players = game.Players.LocalPlayer local genUpgrade = game.Workspace.Players.Motorcycle while true do wait() genUpgrade.Value = genUpgrade.Value + 20 end
Do you have an instance named "Players" in workspace or did you make a mistake?
If you do, my code should work