ok so i want to clone my self by presing a key lets say Q how do i do it??
✓ ANSWER ACCEPTED
how do i clone my self with a key?'
1 answer
✓ Accepted answer
I highly assume that you want that clone to be replicated. So here's my answer:
Stage 1 - Setup
Put a
RemoteEventcalled "PlayerClone" inReplicatedStoragePut a
LocalScriptcalled "CloneHandler" inStarterCharacterScriptslocated inStarterPlayerPut a
Scriptcalled "CloneStarter" inServerScriptService
Stage 2 - LocalScript
--[ Configuration ]--
Key = Enum.KeyCode.Q
Interval = 0.5 --> Put 'false' if you don't want a delay between each clone, otherwise intervals are counted in seconds.
--[ Core Script ]--
PlayerClone = game.ReplicatedStorage.PlayerClone
UIS = game:GetService("UserInputService")
Waiting = false
UIS.InputBegan:Connect(function(KeyPressed)
if not Interval then
Interval = 0
end
if not Waiting then
Waiting = true
--
if KeyPressed.KeyCode == Key then
print('Fired!')
PlayerClone:FireServer()
end
--
wait(Interval)
Waiting = false
end
end)
Stage 3 - Script
--[ Core Script ]--
PlayerClone = game.ReplicatedStorage.PlayerClone
PlayerClone.OnServerEvent:Connect(function(plr)
print('Got Signal!')
local function Clone(plr)
local Player = Instance.new('Model')
Player.Parent = plr.Character.Parent
Player.Name = plr.Name
for _, object in pairs(plr.Character:GetChildren()) do
local _ = object:Clone()
_.Parent = Player
end
end
Clone(plr)
end)
You're done!
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
https://www.robloxdev.com/code-sample/UserInputService-InputBegan https://www.robloxdev.com/api-reference/function/Instance/Clone