I have a touched script that does codes, After the codes I put a wait time and then a clone code which clones and puts a LocalScript into the same person who touched the Part, It doesn't even clone, The rest of the code works, Here is the whole code:
local ATMPart = script.Parent
wait ()
ATMPart.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local Torso = hit.Parent.Torso
local ATM = game.Workspace.ATM
if player and hit.Parent:FindFirstChild("Card") then
wait ()
hit.Parent.Humanoid.WalkSpeed = 0
wait (0.5)
Torso.CFrame = CFrame.new(Torso.Position, ATM.Position)
wait (0.2)
hit.Parent.Humanoid.WalkSpeed = 10
while wait() do
local ATM = game.Workspace.ATMLine.Position
hit.Parent.Humanoid:MoveTo(ATM)
end
hit.Parent.Humanoid.WalkSpeed = 0
wait (0.1)
local new_script = script:findFirstChild("LocalScript"):Clone()
new_script.Parent = hit.Parent
end
end)
Here is the part that isn't working atm
local new_script = script:findFirstChild("LocalScript"):Clone()
new_script.Parent = hit.Parent
Why is it not cloning!?
No errors in the output either.
