I am still very confused tho, why would i want to put it in StarterCharacterScripts even if it doesn’t work?
It just goes in there for some reason… try it?
I already did that and it still doesn’t change anything
So it doesnt work in either StarterCharacterScripts
and StarterPlayerScripts
??
When you’re player dies is the scripts still in the player?
That is exactly correct, yes indeed.
Nope, they dissapear for some strange reason?
Archiveable? It makes things disappear
Yes they are all archivable indeed.
It is most likely a bug but just add a player.Humanoid.dead
event and loop through starterplayer and startercharacter with a for loop and clone the scripts to the player and the character.
Ok, so i put this in each script or i create a new script?
Well it’s an event so it would run no matter where it is so you can put it in an existing or a new script.
Does it need to be a Local Script or a Server Script?
It can be in either one it doesn’t really matter because it will both do it anyway.
Edit: this is not true now that i think about it. It has to detect whether you player died so it would need to be in a local script.
Here is a line of code you can use.
local players = game:GetService("Players")
local player = players.LocalPlayer
local value = 0
player.Character.Died:Connect(function()
value = 1
end)
player.CharacterAdded:Connect(function()
------------------------------------------------------------------------------------------------------
For i, v in pairs(Game.StarterPlayer.StarterCharacterScripts:GetChildren()) do
If Value == 0 then break end
if v:IsA("LocalScript") or v:IsA("ModuleScript") then
v:Clone().Parent = player.PlayerScripts
if I == #Game.StarterPlayer.StarterCharacterScripts:GetChildren() then break end
end
------
end)
---this needs to be a local script.
Thank you, i did it like this and it only works when the player dies how do i make it so it’s when the player respawns?
--//Variables//--
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local LE = script.LandingEffects
local TJ = script["Triple Jump"]
local WE = script.WalkingEffects
--//Function//--
function onHumanoidDied()
--------------------------
local LEClone = LE:Clone()
local TJClone = TJ:Clone()
local WEClone = WE:Clone()
LEClone.Parent = Character
TJClone.Parent = Character
WEClone.Parent = Character
--------------------------
LEClone.Enabled = true
TJClone.Enabled = true
WEClone.Enabled = true
end
--//Connection//--
Humanoid.Died:Connect(onHumanoidDied)
Oh you can just change the event to Player.CharacterAdded()
.
Doesn’t work, do you think i need to put the CharacterAdded function in a PlayerAdded function?
No you only need to do that if the player is loading in not the character.
Maybe you could make the script only run after the players character has loaded, you could do something like if Player.CharacterAdded then