Hello, i don't know how to transform this code:
function onTouched(hit) local d = hit.Parent:GetChildren() for i=1, #d do if (d[i].className == "Accessory") then d[i]:remove() end end end
script.Parent.Touched:connect(onTouched)
For when the player spawns, it execute.
try this in a normal script in the workspace
local spawn = start spawn local spawnfolder = Instance.new('Folder') spawnfolder.Name = spawnfolder --put your spawns here spawnfolder.Parent = workspace for i,v in pairs(spawnfolder:GetChildren()) do if v:IsA('BasePart') then v.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and game.Players:FindFirstChild(hit.Parent.Name) then spawn = v.Name end end) end end game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(char) char.HumanoidRootPart.CFrame = CFrame.new(spawnfolder:FindFirstChild(spawn).CFrame.x,spawnfolder:FindFirstChild(spawn).CFrame.y+3,spawnfolder:FindFirstChild(spawn).CFrame.z) end) end)
i think this will work