I'm making a plot system and I wanted to code that when the player joins they get teleported to their plot, But for some reason it doesn't work, I've tried everything like searching it up but it doesn't work, May anyone help me?
Btw no errors
Code:
local Players = game:GetService("Players")
local plotTemplate = game:GetService("ReplicatedStorage"):FindFirstChild("Plot")
Players.PlayerAdded:Connect(function(player)
local clonePlot = plotTemplate:Clone()
clonePlot.Name = player.Name.."'s Plot"
clonePlot.Parent = workspace:FindFirstChild("Plots")
player.CharacterAdded:Connect(function(char)
if char then
char:FindFirstChild("HumanoidRootPart").CFrame = clonePlot:FindFirstChild("SpawnPoint").CFrame
end
end)
end)

1 comment
Nvm I needed to add a wait