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

my sword scripts breaks when eqquiping the sword?

Asked by 3 years ago

hello i was trying to make a crucible but problems came running to me so yeah.

the problem im having is the script is not responding to functions

let me explain what i mean i called a function

so

here is a example code

-- NOT THE CODE THIS IS A EXAMPLE
Tool.Eqquiped:Connect(function()
       print("yay")
end)

now the thing im confused about is when i eqquip it. it does not print anything.

i dont know honestly.

this crap is confusing.

i will put my real code here

local Tool = script.Parent
local isSwinging = false

Tool.Equipped:Connect(function()
    print("eq")
    local Tool = script.Parent
    local char = Tool.Parent
    local humanoid = char.Humanoid
    local eqLD = humanoid:LoadAnimation(script.Parent.Eq)
    local idleLD = humanoid:LoadAnimation(script.Parent.Idle)
    local swingLd = humanoid:LoadAnimation(script.Parent.CSWING1)
    script.Parent.Handle.UnsheathSound:Play()
    eqLD:Play()
    wait(3)
    idleLD:Play()
    Tool.Activated:Connect(function()
        print("Play")
        script.Parent.Handle.SlashSound:Play()
        warn(error)
        idleLD:Stop()
        swingLd:Play()
        isSwinging = true
        wait(3)
        isSwinging = false
        idleLD:Play()
        swingLd:Stop()
    end)
    Tool.Unequipped:Connect(function()
        print("uneq")
        swingLd:Stop()
        eqLD:Stop()
        idleLD:Stop()
    end)
end)

script.Parent.Hitbox.Touched:Connect(function(hit)
    if isSwinging then
    script.Parent.Handle.HitSound:Play()
    local hum = hit.Parent:WaitForChild("Humanoid")
    hum.Health = 0
    end
end)

if anybody knows whats going on please help in the comments.

0
Is there an error? seanieplays 88 — 3y
0
no error just does not work. CallMe_Axis 63 — 3y
0
i have no idea whats going on. CallMe_Axis 63 — 3y
0
Did you check your console? Xyternal 247 — 3y
0
nothing in the console either CallMe_Axis 63 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago

typo

Eqquiped:Connect

its Equipped

Ad

Answer this question