Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

why my sword wont do anything after click. can someone tell me what am I doing wrong?

Asked by 3 years ago
Edited 3 years ago

I have my own model of sword (named rusty dagger) and even animations for attack, idle and equipt. I searched thru whole youtube and google but I can just find any script that would work. no matter what script I write my dagger still doesnt do anything. Everytime I click nothing happens. I tryed four diffirent script allready but its still no doing anything. Does anyone have any idea what am I doing wrong or some script to send that would work? theese are script that I used: script.Parent

script.Parent

local function onTouch(partOther)

local humanOther = partOther.Parent:FindFirstChild("Huamnoid")

if not humanOther then return end

if humanOther.Parent == tool then return end

humanOther:TakeDamage(5)
end

 local function slash()

local str =Instance.new("StringValue")
str.Name = "toolanim"
str.Value = "slash"
str.Parent = tool
end

tool.Activated:Connect(slash)
tool.Handle.Touched:Connect(onTouch)

second

script.Parent.blade.Touched:connect(function(p)

if script.Parent.CanDamage.Value == true then

script.Parent.CanDamage.Value = false

p.Parent.Humanoid:TakeDamage(20)

end

end)


local CanAttack = true script.Parent.Activated:connect(function() local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack) if CanAttack == true then attack:Play() CanAttack = false wait(1) attack:Stop() CanAttack = true script.Parent.CanDamage.Value = true end end)
0
code block, Also is there any errors? Pupppy44 671 — 3y
0
it didnt show any errors Robert123456789l 2 — 3y
0
can you please put your codei n a codeblock? zadobyte 692 — 3y

Answer this question