Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Text and object value not being set in Player Removing function?

Asked by 2 years ago
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.

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? theking66hayday 841 — 2y
0
Solved it, sorry. The issue was that script was placed in the wrong area. All good now though  SamZeKat 28 — 2y

Answer this question