So in this script (located in server script service) is supposed to increase your damage based on each level. The damage works, but the damage value doesn't increase.
PROBLEM: Damage Value does not increase on each level.
Someone help ?
This is FE.
local ServerStorage = game:GetService('ServerStorage') local strength = ServerStorage.Values:FindFirstChild('Strength').Value script.Parent.Touched:Connect(function(hit) local DmgValues = {script.Dmg.Value, script.DmgCritical.Value, script.Dmg2.Value, script.Dmg3.Value, script.DmgCritical2.Value} local char = hit.Parent local hum = char:FindFirstChild("Humanoid") local chance = math.random(1, #DmgValues) if strength == strength*1 then script.Dmg.Value = script.Dmg.Value + 1 script.DmgCritical.Value = script.Dmg.Value + 2 script.Dmg2.Value = script.Dmg.Value + 1 script.DmgCritical2.Value = script.Dmg.Value + 2 script.Dmg3.Value = script.Dmg.Value + 1 end if hum and char.Name ~= script.Parent.Parent.Name then hum.Health = hum.Health - DmgValues[chance] script.Disabled = true wait(0.5) script.Disabled = false end end)
Try this:
local CanTouch = true local ServerStorage = game:GetService('ServerStorage') local strength = ServerStorage.Values:FindFirstChild('Strength').Value script.Parent.Touched:Connect(function(hit) if CanTouch == true then local DmgValues = {script.Dmg.Value, script.DmgCritical.Value, script.Dmg2.Value, script.Dmg3.Value, script.DmgCritical2.Value} local char = hit.Parent local hum = char:FindFirstChild("Humanoid") local chance = math.random(1, #DmgValues) if strength == strength*1 then script.Dmg.Value = script.Dmg.Value + 1 script.DmgCritical.Value = script.Dmg.Value + 2 script.Dmg2.Value = script.Dmg.Value + 1 script.DmgCritical2.Value = script.Dmg.Value + 2 script.Dmg3.Value = script.Dmg.Value + 1 end if hum and char.Name ~= script.Parent.Parent.Name then hum.Health = hum.Health - DmgValues[chance] CanTouch = false wait(.5) CanTouch = true end else wait(.5) CanTouch = true end end)
I just added a variable