Okay so, I'm trying to make a claiming door, but I need it to be so that when the player THAT OWNS the door gets their room wiped so that someone else can claim it. But I don't know how to make this local because whenever someone leaves it makes all of the rooms available. Even though I want it to be for that player only who left.
Here's my code:
local Click = script.Parent.ClickDetector
local default = ""
local defaultAv = "Available Room"
local ImageLabel = script.Parent.Parent.Gold3.SurfaceGui.ImageLabel
local text2 = script.Parent.Parent.Gold.SurfaceGui.TextLabel
local UserValue1 = script.Parent.Parent.WhoID
local UserValue2 = script.Parent.Parent.WhoUser
Click.MouseClick:Connect(function(playerWhoClicked)
UserValue2.Value = playerWhoClicked.Name
Click.MaxActivationDistance = 0
UserValue1.Value = playerWhoClicked.UserId
text2.Text = playerWhoClicked.Name.."'s Room"
end)
game.Players.PlayerRemoving:Connect(function()
ImageLabel.Image = "rbxasset://textures/ui/GuiImagePlaceholder.png"
UserValue1.Value = default
UserValue2.Value = default
text2.Text = defaultAv
Click.MaxActivationDistance = 10
end)
Basically, tell me how to make the "game.Players.PlayerRemoving" local.
Thanks!

1 comment
Also, this is a script in the Workspace.