I made this dead script thingy it works fine besides it wont put the clone in workspace...
Character = script.Parent Dead = game.Lighting.Dead Humanoid = Character.Humanoid function OnDeath() wait(0.5) game.lighting.Dead:Clone() Dead.Parent = game.Workspace game.Workspace.Dead.HumanoidRootPart.Position = Character.HumanoidRootPart.Position Dead.Parent = game.Workspace end Humanoid.Died:connect(OnDeath)
I'm trying to understand what you're doing, but front what I can read you're trying to get a model from lighting, clone it and parent it to workspace. Then making that model be in the same position the character is when the character dies.
Assuming that I can actually go about fixing this.
--//Putting "local" in front of variables only used in the scope that it's in is good practice local Character = script.Parent local Dead = game.Lighting.Dead:Clone() --//Getting our Dead model. I'm calling clone here because just in case anything happens to the model inside of lightning, we'll always have a copy. local Humanoid = Character.Humanoid function OnDeath() local rootPosition = Character:GetPrimaryPartCFrame() --//Getting the CFrame of the root of the character local deadClone = Dead:Clone() --//Cloning our Dead model from lighting wait(0.5) deadClone:SetPrimaryPartCFrame(rootPosition) --//I'm assuming that it has a primarypart in it because it has a HumanoidRootPart inside of it. deadClone.Parent = game.Workspace end Humanoid.Died:connect(OnDeath)
I describe most of what I'm doing in the scripts comments, but I'm basically just doing what I said above.