So i made a item shop and when you purchase a sword it puts it in your inventory. Now, it works but the sword doesn't. Now this could just be a scripting error right? No. Because when I place the sword straight into the starter pack, it works perfectly! Any help would bee appreciated

Also here is the script to the sword just in case any of you want to see it.

script.Parent.Equipped:Connect(function()
script.Parent.Activated:Connect(function()
script.Parent.Handle.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild('Humanoid') then
		hit.Parent.Humanoid:TakeDamage(5)
		local clone = script:Clone()
		clone.Parent = script.Parent
		script:Destroy()
		end
	end)
	local animation2 = script.Parent.SideSwipe
		local play2 = script.Parent.Parent:WaitForChild("Humanoid"):LoadAnimation(animation2)
		play2:Play()
		script.Parent.Attack:Play()
	end)
end)

4 comments

0

Is it a welded tool?

0

Is it a localscript?

0

is there welds?

0

Yes Yes and yes