Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

my sword scripts breaks when eqquiping the sword?

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.

5 comments

0

Is there an error?

0

no error just does not work.

0

i have no idea whats going on.

0

Did you check your console?

0

nothing in the console either

1 answer

✓ Accepted answer

typo

Eqquiped:Connect

its Equipped

This discussion is preserved as it was. New answers, comments, and votes are closed.