Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Cloning The Character [closed]

Asked by 10 years ago

This question already has an answer here:

How do you clone someone's character?

Okay, so currently I am working on Cloning the Character as it touches a Part I have set in my place, seems easy enough, but I cannot get it to work. Here is my code:

script.Parent.Touched:connect(function(part) part.Parent.Torso.CFrame = CFrame.new(-8.076, 6, 59.935) part.Parent.Torso.Anchored = true local body = part.Parent:clone() body.Torso.CFrame = CFrame.new(2.041, 6, 59.982) body.Torso.Anchored = false

end)

The only error I get is the following:

20:23:13.538 - Workspace.Plate.Script:5: attempt to index local 'body' (a nil value) 20:23:13.538 - Script 'Workspace.Plate.Script', Line 5 20:23:13.539 - stack end 20:23:13.539 - Disconnected event because of exception

Any help would be appreciated, Thanks.

Marked as Duplicate by User#2

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?