Here's your current script:
local button = game.Workspace.ArenaSpawn
local function createclone(other)
local parent = other.Parent
if game.Players:GetPlayerFromCharacter(parent)then
end
end
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
local button = game.Workspace.ArenaSpawn
local Done = false
local function createclone(other)
humanoid = other.Parent:FindFirstChild("Humanoid")
if humanoid and not Done then
local player = other.Parent
player.Archivable = true
local Clones = player:Clone()
Clones.Parent = game.Workspace
Clones:MoveTo(button.Position)
player.Archivable = false
Done = true
end
end
button.Touched:connect(createclone)
#2 This is for many time use with a cool down of one second
local button = game.Workspace.ArenaSpawn
local Done = false
local function createclone(other)
humanoid = other.Parent:FindFirstChild("Humanoid")
if humanoid and not Done then
Done = true
wait(1)
local player = other.Parent
player.Archivable = true
local Clones = player:Clone()
Clones.Parent = game.Workspace
Clones:MoveTo(button.Position)
player.Archivable = false
Done = false
end
end
button.Touched:connect(createclone)
9 comments
sorry first post so i dont know how to properly type code in
A clone as in a model that is not moving?
yeah that would be fine, i have a script to make it move
also sorry for the late reply, im in the process of trying to fix it lol
You will have to use :Clone()
Will the clone spawn at spawn?
i was looking to spawn it at a specific location not spawn
Try out my answer, it should spawn the clone at a specific location.
What is players value?