What do you want to achieve? Keep it simple and clear! two buttons able to add speed and substract soeed
What is the issue? i cant script
so i want a button that doesnt set your speed to a point but adds speed or substracts. like if you click it you get +2 speed and if you click the other one you speed gets -2
What should clicking the button add a value to? An Int value? A variable containing a number?
The “What you want to achieve” section doesn’t tell much.
here is an outline :
local button = script.Parent -- GUI object
value = 0
button.MouseButton1Click:Connect(function()
value = value + 2 -- add 2?
print(value)
end)
not really into a gui. so this is what i have: two blocks (buttons) that when one is clicked, it adds 2 speed to the player that clicked it. when the other one is clicked, it substracts 2 speed from the player that clicked it. what i should have*
yes, long story short, im making a character size changer game, one part makes the player grow and the other shrink, so i wanted to make it that if someone clicks the grow button you would also become faster otherwise it looks weird seeing someone big walk slow, and the shrink makes slower. the size changing is already done but now i need a way to add and substract speed through a clickdetector script
Personally I’d say the opposite, I think that a cool game mechanic would be that the bigger someone is the slower they move. It gives smaller people a better advantage in the game. Of course I don’t know anything about the context of your game, but take agar.io for example - it works really well because of the speed mechanic.