hello again scripting helpers, i have no clue how to make add a multiplier to humanoid:takedamage.
btw the multiplier is a NumberValue thats in the player model
the line i wanna add the multiplier to
humanoid:TakeDamage(46)
hole script
local tool = script.Parent local canDamage = false local Cooldown = false stronkness = script.Parent.Parent.Strength.Value local WaitTime: number = .5 --cool down local function onTouch(otherPart) local humanoid = otherPart.Parent:FindFirstChild("Humanoid") if not humanoid then return end if humanoid.Parent ~= tool.Parent and canDamage then humanoid:TakeDamage(46) tool.Handle.HitSound.TimePosition = 0 tool.Handle.HitSound.Playing = true else return end canDamage = false end local function slash() if Cooldown then return end Cooldown = true local str = Instance.new("StringValue") str.Name = "e" --idk why i made it e, i just edited the script that i used for an old game str.Value = "Slash" str.Parent = tool canDamage = true wait(WaitTime) Cooldown = false end local function swingsound() wait(.3) -- time untill swing sound plays tool.Handle.SwingSound.TimePosition = 0 tool.Handle.SwingSound.Playing = true end tool.Activated:Connect(swingsound) tool.Activated:Connect(slash) tool.Handle.Touched:Connect(onTouch)
thanks in advence
So, if I understand you correctly, you want to multiply the damage with the value of the NumberValue.
Fixed Script
local tool = script.Parent local canDamage = false local Cooldown = false stronkness = script.Parent.Parent.Strength.Value local WaitTime: number = .5 --cool down local function onTouch(otherPart) local humanoid = otherPart.Parent:FindFirstChild("Humanoid") local client = game:GetService("Players"):GetPlayerFromCharacter(otherPart) local num = client:FindFirstChildWhichIsA("NumberValue") if humanoid.Parent ~= tool.Parent and canDamage then local damage = 46 * num.Value humanoid:TakeDamage(damage) tool.Handle.HitSound.TimePosition = 0 tool.Handle.HitSound.Playing = true end canDamage = false end local function slash() if Cooldown then return end Cooldown = true local str = Instance.new("StringValue") str.Name = "e" --idk why i made it e, i just edited the script that i used for an old game str.Value = "Slash" str.Parent = tool canDamage = true wait(WaitTime) Cooldown = false end local function swingsound() wait(.3) -- time untill swing sound plays tool.Handle.SwingSound.TimePosition = 0 tool.Handle.SwingSound.Playing = true end tool.Activated:Connect(swingsound) tool.Activated:Connect(slash) tool.Handle.Touched:Connect(onTouch)