Hello! The title might not make sense, and I’ll explain it to you.
I have a script where if you fall off the edge, you die by getting turned to stone (the character gets anchored in the process).
Works well, but the thing is I don’t want the player to actually DIE. I thought of making a clone of the stone/dead character and placing him where the player “died”, but have the actual player in a different, not on the edge spot.
How do I go about this?
SCRIPT:
local Anti = script.Parent.Part
local particles = script.Parent.ParticleEmitter
Anti.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local char = hit.Parent
local clonedEmitter = particles:Clone()
clonedEmitter.Parent = char.HumanoidRootPart
clonedEmitter.Enabled = true
wait(1)
for _, charPart in pairs(char:GetChildren()) do
if charPart:IsA("BodyColors") then
charPart.HeadColor3 = Color3.fromRGB(86, 86, 86)
charPart.LeftArmColor3 = Color3.fromRGB(86, 86, 86)
charPart.RightArmColor3 = Color3.fromRGB(86, 86, 86)
charPart.LeftLegColor3 = Color3.fromRGB(86, 86, 86)
charPart.RightLegColor3 = Color3.fromRGB(86, 86, 86)
charPart.TorsoColor3 = Color3.fromRGB(86, 86, 86)
elseif charPart:IsA("Clothing") then
charPart:Remove()
elseif charPart:IsA("BasePart") then
charPart.Anchored = true
charPart.Color = Color3.fromRGB(84, 84, 84)
charPart.Material = Enum.Material.Slate
end
end
wait(0.25)
clonedEmitter.Enabled = false
wait(0.5)
clonedEmitter:Remove()
wait(1)
--past here is where I want the cloning to happen
char.Humanoid.Health -= char.Humanoid.Health
end
end)
TL;DR - Want to make clone of statue/dead player, but have the actual player in safe area.
But I forgot to say, the player freefalls before they get anchored and turned to stone. The camera still follows the dying player. I’m not the best at scripting so I’m not sure how to go about this.
You can clone the player’s character right before it dies, set it to stone, set the player’s camera to the cloned character, play the effects and after the effect is done, set the camera back to the player.
You could just teleport the player elswere and resets its clothings and body color, or if you want a clone you can change the camera to the clone and than back again,
local cam = game.Workspace.CurrentCamera
cam.CameraSubject = clone.Humanoid
then to get it back
cam.CameraSubject = char.Humanoid
Well, send a remote then, But That could get som issue with latency. You really should use the actuall player and then give back the collors/ cloth when you teleport away
local model = Instance.new("Model", workspace)
for _, part in pairs(character:GetChildren()) do
part.Parent = model
end
this is a much better alternative than cloning the character where he died, every part of the character is put inside a model in the workspace, the character can still respawn after that and you can also clean the model after a while
Sorry for the late reply. I didn’t want the player to actually DIE, I want a clone of the statue player while having the actual player model in a safe spot.