I created a tool that shoots a ball at an object with RocketPropulsion after the ball is spawned the script should clone a script in the Lighting(I tried with ReplicatedStorage too) and put it in. but after it's done the cloned script doesn't run at all.
the interessting part of the first script.(its a localscript)
local source = script.Parent
.
.
.
local missile = Instance.new("Part")
.
.
.
missile.Parent = game.Workspace
local boomscript = game.Lighting.Randomstuff.Script:Clone()
boomscript.Parent = missile
and here is the second one(this is a normal script)
local missile = script.Parent
print("do you even run?")
print(missile.Name)
wait(0.009)
function asdhitting(asd)
print("are you there?")
if missile.Name == asd.Parent.Parent.Name then
print("b1")
else
print("g1")
if asd then
print("g2")
local hum = asd.Parent:FindFirstChild("Humanoid")
if hum then
print("g3")
local Res = asd.Parent:FindFirstChild("Resist")
if Res then
print("b4")
if Res.Value >= 1 then
Res.Value = Res.Value-1
if Res.Value <= 0 then
Res:Destroy()
local bodyparts = Res.Parent.Head, Res.Parent:FindFirstChild("Right Arm"), Res.Parent:FindFirstChild("Left Arm"), Res.Parent.Torso, Res.Parent:FindFirstChild("Right Leg"), Res.Parent:FindFirstChild("Left Leg")
local victim = asd.Parent
bodyparts.BrickColor = BrickColor.new("Red")
victim.Humanoid.Health = victim.Humanoid.Health - 5
if victim.Humanoid.Health <= 0 then
local murderer = missile.Name
print(murderer .. "killed" .. asd.Parent.Name)
end
end
else
print("g4")
print("asdf")
local victim = asd.Parent
victim.Humanoid.Health = victim.Humanoid.Health - 10
if victim.magic then
victim.magic.Value = victim.magic.Value - 2.5
if victim.magic.Value < 0 then
victim.Humanoid.Health = victim.Humanoid.Health - 5
end
end
if victim.Humanoid.Health <= 0 then
local murderer = missile.Name
print(murderer .. "killed" .. asd.Parent.Name)
end
end
end
missile:Destroy()
end
end
end
end
script.Parent.Touched:connect(asdhitting)
sorry if it's too long. and something is even stranger. this script worked correctly in the past.
Thank you.

4 comments
So you are cloneing a script with a server script??
Can you give us more details as to how you're running the local script, where you're running it, what exactly you are doing to test this script? LocalScripts do not run as being a direct descendant of workspace, you must have it in a Character, PlayerGui, Backpack, or PlayerScripts.
the localscript is in a tool. the tool is in the Character. i start the localscript with Activated event and the server script with touched.
Really i wouldn't use lighting to store things but...