Title. I can't figure out why this keeps happening.

game.Players.PlayerRemoving:Connect(function(player)
	local playershomeaccount = workspace.HasAHome:FindFirstChild(player.Name)
	playershomeaccount:Destroy()
	local playersaddressaccount = workspace.WhatHome:FindFirstChild(player.Name) -- this is where the script breaks.
	local plotToRemove = workspace:FindFirstChild(playersaddressaccount)
	plotToRemove:Destroy()
	local whatclone = game.ServerStorage:FindFirstChild(playersaddressaccount)
	local clone = whatclone:Clone()
	clone.Parent = workspace
	playershomeaccount:Destroy()
end)

3 comments

0

Variable playersaddressaccount is nil, either that or player.Name is nil at the time of player removal. Everything is too ambiguous, I should probably mark this as too broad.

0

what ine?

0

well if you would of read it you would see it, soooooo