The script is a server event that where a player presses a key, a certain value will get multiplied each time the server event is fired. However, the same value is repeated and not getting multiplied.

script.Parent.OnServerEvent:Connect(function(Player, Action)
	
	local Damage = math.random(20,30) + Player:WaitForChild("GameValues").strength.Value * 1.5
	local BoostedDamage = Instance.new("NumberValue")
	BoostedDamage.Name = "BoostedDamage"
	BoostedDamage.Value = Player.GameValues.strength.Value
	BoostedDamage.Parent = Player.GameValues
	
	if Action == "Boost" then
		BoostedDamage.Value = BoostedDamage.Value * 0.5
		print(BoostedDamage.Value)
	end
end)

3 comments

0

Do you mean BoostedDamage.Value = BoostedDamage.Value * damage?

0

BoostDamage is always being set to the players strength and since that doesn't change it will always be 1/2 of strength.

0

would I need to write the instance for boosted damage in another script then?