So I created a local script that is located inside the Starter Player scripts, and it is supposed to remove the objects, when the player dies.
This clearly works when running in studio, but when i am in-game it malfunctions and the output says
attempt to index field 'Character' (a nil value)
here's the local script.
THE GAME IS FE.
-- // Variables //
local Player = game.Players.LocalPlayer
local repstorage = game.ReplicatedStorage
local part1 = game:FindFirstChild('PART1Clone')
local part2 = game:FindFirstChild('PART2Clone')
local event = repstorage.ServerEvent
local activated = game.ReplicatedStorage.On
-- // Function //
repeat wait() until Player.Character
Player.Character.Humanoid.Died:connect(function()
part1:Remove()
part2:Remove()
activated.Value = false
end)

5 comments
line 15 you have no end)?
The problem is that the code is running before the player's character has spawned. Try waiting until the character exists, and same with the humanoid.
i did that too @thedeadlypanther because the guy that answered told me to do that. look at the answer
I fixed your script I beleive.
I added it to my answer.