basicaly i have a bootvalue in one of the scripts when i press F it gets buffed and bootvauled sets to true then in another script it checks if value is true if it is it should buff the damage if its false then damage should be normal but it doesnt works help?
heres the script
///////////////////////////////
local tool = script.Parent.Parent
local Blade = tool:WaitForChild("Blade")
local Particle1 = Blade:WaitForChild("Lightning1")
local Buffed = tool:WaitForChild("Buffed")
tool:FindFirstChild("Buffed")
Buffed.Changed:Connect(function()
if Buffed.Value == true then
wait(1)
local debounce = false
local HealthLoss = 100
function OnTouched(Part)
if Part.Parent ~= nil then
if debounce == false and Part.Parent:findFirstChild("Humanoid") ~= nil then
debounce = true
Part.Parent:findFirstChild("Humanoid"):TakeDamage(HealthLoss)
wait(0.4)
debounce = false
wait(1)
end
end
end
end
end)
tool:FindFirstChild("Buffed")
if Buffed.Value == false then
local debounce = false
wait(1)
local HealthLoss = 50
function OnTouched(Part)
if Part.Parent ~= nil then
if debounce == false and Part.Parent:findFirstChild("Humanoid") ~= nil then
debounce = true
Part.Parent:findFirstChild("Humanoid"):TakeDamage(HealthLoss)
wait(0.4)
debounce = false
end
end
end
Buffed.Value = false
end
script.Parent.Touched:connect(OnTouched)
////////////////////////////

6 comments
oof didnt even notice ill fix it and try after
i fixed the lines but it still does 50 dmg even if bootvalue is true
I just foudn something: move your function out of your if statement. That may do something. I'm not near my roblox studio right now so this answer is 100% hypothetical. Still try it, though.
nope nothing changed still 50 dmg maybe its the damage script can you look at it more
im gonna try to make 2 different scripts that both check the boot value maybe it will work '''_('.')_/'''
I just revised my answer and your script, tell me if it doesn't work or if you need me to explain any of it.