You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Create a power system for how hard you hit the projectile -
What is the issue? Include screenshots / videos if possible!
The boolean value increases when you click the decrease button and vice versa
https://gyazo.com/4103709928d26df3e4c918a051e80259 -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Changing the server script instead of using a number to decide how much power needs to be added/decreased to either be negative or positive
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local scripts
Increase
local button = script.Parent
local plr = game.Players.LocalPlayer
button.Activated:Connect(function()
if plr.Power.Value < 11 then
game.ReplicatedStorage.RemoteEvents.Value.Power:FireServer(1)
print(plr.Power.Value)
button.Parent.Power.Text = plr.Power.Value
else
button.Parent.Power.Text = 10
end
end)
Decrease
local button = script.Parent
local plr = game.Players.LocalPlayer
button.Activated:Connect(function()
if plr.Power.Value > 1 then
game.ReplicatedStorage.RemoteEvents.Value.Power:FireServer(-1)
print(plr.Power.Value)
button.Parent.Power.Text = plr.Power.Value
else
button.Parent.Power.Text = 1
end
end)
Server script
game.ReplicatedStorage.RemoteEvents.Value.Power.OnServerEvent:Connect(function(plr,amount)
plr.Power.Value = plr.Power.Value+amount
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.