I've made a script that clones a mesh in front of the player so that when the player clicks the tool it spawns the part as it's supposed to. The problem is that the part being cloned has a script inside of it but it does not trigger or cause an error in the output for whatever reason. Here's the script inside of the tool that clones the mesh: (It's a local script fyi)
local tool = script.Parent
debounce = true
tool.Activated:Connect(function()
if debounce == true then
debounce = true
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local animation = script.Parent.DashMover
local Anim1
local Slash = game.ReplicatedStorage.SlashD:Clone()
Slash.Parent = character.Torso
local offset = Vector3.new(0,0,-5)
Slash.CFrame = character.Torso.CFrame*CFrame.new(offset)
wait(0.1)
for i = 1,10 do
Slash.Transparency = Slash.Transparency + 0.1
wait(0.05)
end
Slash:Destroy()
debounce = true
end
end)
And this is the script inside of the cloned mesh: (This is inside of a serverscript)
local Debounce = false
script.Parent.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")and Debounce == false then
Debounce = true
hit.Parent.Humanoid:TakeDamage(10)
wait(0.1)
Debounce = false
end
end)
Any help is appreciated!

8 comments
How would I get the damage script into the part? I've never done something like that before.
if the part hits a part of the player then it takes damage from the humanoid like Humanoid:TakeDamage(25)
orr you can subtract the health
I mean like how would I get the actual script inside the part. I've already got the script to take damage from the player
you can't
then instance.new wouldn't work :I
I misunderstood you.
gotcha