local owner = script.Parent.Parent.Parent.Owner
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local text = script.Parent.BillboardGui.TextLabel
local defaultText = "Claim"
local Players = game:GetService("Players")

Players.PlayerRemoving:Connect(function(player)
	if player.Character == owner.Value then
		owner.Value = nil
		text.Text = defaultText
		print("User left. House is now for sale.")
	end
end)

The debug print line does print, but the text does not change to defaultText, and owner.Value is not set to nil. owner.Value is an object value that is attached to the user leaving.

2 comments

0

Hi can you explain where you put this script and or is it a local script or just a script? And what is this suppose to do?

0

Solved it, sorry. The issue was that script was placed in the wrong area. All good now though