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

[SOLVED] How do I make PlayerRemoving local?

Asked by 3 years ago
Edited 3 years 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 48 — 3y

2 answers

Log in to vote
0
Answered by
M9F 94
3 years ago

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

0
I'm going to add you M9F 94 — 3y
0
I'm going to add you M9F 94 — 3y
0
It's alright, I figured out how to make it local CoolBlueJay000 48 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

I figured out how to make it local

Answer this question