So i create a folder once a player joins, where i store something important in it, but if the player dies, another folder is created and the old one is left, how do i fix this?

-Edit whoops wrong script

Script -

------------------------------------------------------------------------------|
     local Stando = Instance.new("Folder")
	 local Character = script.Parent
     local StandStorage = game.ReplicatedStorage:WaitForChild("Stands")
     local Player = game.Players:FindFirstChild(Character.Name)
	 local Folder = Player:WaitForChild("Stand")
     local PlayersStand = Folder:WaitForChild("PlayersStand").Value
     local Summoner = script.Summoner:Clone()
     local AnimPlayer = script.AnimationPlayer:Clone()
     local BoolSummon = Instance.new("BoolValue")

--------------------------------------------------------------------------------
    
        BoolSummon.Name = "Summon"
        Stando.Name = "Stand"
        Stando.Parent = game:GetService("Workspace")
     local Stand = StandStorage:WaitForChild(PlayersStand):Clone()
        Stando.Name = Character.Name.."_Stand"
     local StandTorso = Stand:FindFirstChild("Torso")
        Stand.Parent = Stando
        BoolSummon.Parent = Stand
        Summoner.Parent = Stand
        AnimPlayer.Parent = Stand
        AnimPlayer.Disabled = false
        Summoner.Disabled = false
        print(Character.Name.. "'s Stand is "..PlayersStand)

The script is a server script, and it' s in StarterCharacterScripts.

1 comment

0

use playeradded and put it in sss