function module.Dmg(plr,dmg)
local char = plr.Character
local hum = char.Humanoid
local dmgTween = tweenService:Create(hum.Health,TweenInfo.new(1,1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false){Health=10})
dmgTween:Play()
if plr.Status.plrEffects:GetAttribute("Bleeding") == false then
dmgTween:Stop()
end
end
BTW: I renamed the function to damage at some point with the same error This is the error:
As Kilo said, multiple things are wrong with your code. Here is a fixed version, with the parameters in the correct order and properly seperated with commas.
function module.Dmg(plr,dmg)
local char = plr.Character
local hum = char.Humanoid
local dmgTween = tweenService:Create(hum,TweenInfo.new(1,Enum.EasingStyle.Linear), {Health=10})
dmgTween:Play()
if plr.Status.plrEffects:GetAttribute("Bleeding") == false then
dmgTween:Stop()
end
end
local tweenService = game:GetService("TweenService")
function module.Dmg(plr, dmg)
local char = plr.Character
local hum = char:FindFirstChildOfClass("Humanoid")
if hum then
local dmgTween = tweenService:Create(hum, TweenInfo.new(1, 1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false), { Health = hum.Health - dmg })
dmgTween:Play()
if plr.Status.plrEffects:GetAttribute("Bleeding") == false then
dmgTween:Stop()
end
else
warn("Humanoid not found in player's character.")
end
end
You are trying to call a function named “Damage” whilst the function that you want to call is named “Dmg”. Also it looks like you forgot to send the 2nd argument (damage amount).
I got a different error this time, so something is working
function module.Dmg(plr, dmg)
local char = plr.Character
local hum = char:FindFirstChildOfClass("Humanoid")
if hum then
local dmgTween = tweenService:Create(hum, TweenInfo.new(1, 1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false), { Health = hum.Health - dmg })
dmgTween:Play()
if plr.Status.plrEffects:GetAttribute("Bleeding") == false then
dmgTween:Stop()
end
else
warn("Humanoid not found in player's character.")
end
end
function module.Dmg(plr, dmg)
local char = plr.Character
local hum = char:FindFirstChildOfClass("Humanoid")
if hum then
local dmgTween = tweenService:Create(hum, TweenInfo.new(1, Enum.EasingStyle.Linear), {Health = 10})
dmgTween:Play()
-- if plr.Status.plrEffects:GetAttribute("Bleeding") == false then
-- dmgTween:Stop()
-- end
--else
-- warn("Humanoid not found in player's character.")
end
end