I have a dodge value that activates whenever there’s a change of value in a boss’s health and for some reason it teleports the boss but doesn’t minus the dodge value? This is the dodge script,
local Value = script.Parent.Parent.Health
local Value2 = script.Parent.Parent.Boss.MaxHealth
local Dodges = script.Parent.Value
local Boss = script.Parent.Parent
Value.Changed:Connect(function(NewValue)
local dodgespot = Vector3.new(math.random(-20,20), 0, math.random(-20,20))
Value.Value = Value2
Dodges = Dodges -1
Boss:TranslateBy(dodgespot)
end)
local Value = script.Parent.Parent.Health
local Value2 = script.Parent.Parent.Boss.MaxHealth
local Dodges = script.Parent.Value
local Boss = script.Parent.Parent
Value.Changed:Connect(function(NewValue)
local dodgespot = Vector3.new(math.random(-20,20), 0, math.random(-20,20))
Value.Value = Value2
Dodges = Dodges -1
print(Dodges)
Boss:TranslateBy(dodgespot)
end)
local Value = script.Parent.Parent.Health
local Value2 = script.Parent.Parent.Boss.MaxHealth
local Dodges = script.Parent
local Boss = script.Parent.Parent
Value.Changed:Connect(function(NewValue)
local dodgespot = Vector3.new(math.random(-20,20), 0, math.random(-20,20))
Value.Value = Value2
Dodges.Value = Dodges.Value -1
print(Dodges.Value)
Boss:TranslateBy(dodgespot)
end)
Yeah I don’t think I applied the edits though but now it seems to work! Now I just have to sort out it decreasing tons by adding a debounce I think when the player hits the boss hehe!