Answered by
7 years ago Edited 7 years ago
Here's your current script:
01 | local button = game.Workspace.ArenaSpawn |
03 | local function createclone(other) |
04 | local parent = other.Parent |
05 | if game.Players:GetPlayerFromCharacter(parent) then |
10 | button.Touched:connect(createclone) |
So you would like a script that would create a clone of the player that touches it. Continuing on on your script, you have already started the part on the button being touched. With that part out of the way, here is how you would clone.
In your script, other, is the hit, which would be the body part of the player. Thus, parent, would be the player. I do suggest you change its name to "Player" to avoid confusion. Anyway, in order to clone, you should use Clone() which will be used to clone the player. After cloning, place the clone into workspace. And finally, to move a model, in this case, a clone, you should use MoveTo() to move the clone to your desired location, in this case, the button.
Here's the new edit, find for the one you'd like:
1 This is for one time use every time touched
01 | local button = game.Workspace.ArenaSpawn |
04 | local function createclone(other) |
05 | humanoid = other.Parent:FindFirstChild( "Humanoid" ) |
06 | if humanoid and not Done then |
07 | local player = other.Parent |
08 | player.Archivable = true |
10 | local Clones = player:Clone() |
11 | Clones.Parent = game.Workspace |
12 | Clones:MoveTo(button.Position) |
13 | player.Archivable = false |
18 | button.Touched:connect(createclone) |
2 This is for many time use with a cool down of one second
01 | local button = game.Workspace.ArenaSpawn |
04 | local function createclone(other) |
05 | humanoid = other.Parent:FindFirstChild( "Humanoid" ) |
06 | if humanoid and not Done then |
09 | local player = other.Parent |
10 | player.Archivable = true |
12 | local Clones = player:Clone() |
13 | Clones.Parent = game.Workspace |
14 | Clones:MoveTo(button.Position) |
15 | player.Archivable = false |
20 | button.Touched:connect(createclone) |