Hi guys! I am having trouble with keeping trails on respawn, if i die or reset, the trail disappears.
Here’s the bit of the script with the issue.
elseif not buying and plr.OwnedTrails:FindFirstChild(trail.Name) then
local char = plr.Character
if not char or not char:FindFirstChild("HumanoidRootPart") then return end
for i, child in pairs(char.HumanoidRootPart:GetChildren()) do
if child:IsA("Trail") then child:Destroy() end
end
local newTrail = trail:Clone()
newTrail.Attachment0 = char.HumanoidRootPart.TrailTop
newTrail.Attachment1 = char.HumanoidRootPart.TrailBottom
newTrail.Parent = char.HumanoidRootPart
end
end)
Player.CharacterAdded:connect(function(char)
repeat wait() until char:FindFirstChild'Humanoid' and char:FindFirstChild'HumanoidRootPart'
for i, child in pairs(char.HumanoidRootPart:GetChildren()) do
if child:IsA("Trail") then child:Destroy() end
end
local newTrail = trail:Clone()
newTrail.Attachment0 = char.HumanoidRootPart.TrailTop
newTrail.Attachment1 = char.HumanoidRootPart.TrailBottom
newTrail.Parent = char.HumanoidRootPart
end)
Just noticed you got this code from @Sub2HTR. He has made a video of a Tower of Hell open-sourced game that contains a trail shop that was modified, that includes a feature where the trail saves when the player resets just like how you mentioned it. You can check it out here, and see the contents for yourself:
thanks for replying, but the gui doesnt even work
dont worry, i’ll just delete the trail gui and scripts but thank you so much for ur help! ill mark your post as the solution. have a good day