0

# [SOLVED] How do I make PlayerRemoving local?

Edited 4 days ago

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!

0
Also, this is a script in the Workspace. CoolBlueJay000 6 — 5d

0

I'm currently busy scripting something but I'll try to help you when I'm done!

0
I'm going to add you IckyTheSuperior 74 — 5d
0
I'm going to add you IckyTheSuperior 74 — 5d
0
It's alright, I figured out how to make it local CoolBlueJay000 6 — 4d