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

Is there a way to get a players character after they leave?

Asked by 5 years ago

I have the following script:

game.Players.PlayerRemoving:Connect(function(plr)

local char = plr.Character

local stats = plr.hidden

local stat = stats.follow

if char:FindFirstChild('Doge') then

local boost = char.Doge.Boost

stat.Value = stat.Value - boost.Value

print('success!')

end

end)

It doesn't work because the players character is gone when the function is fired. Is there any other way to do this?

0
You could try using the CharacterRemoving event on the player, as the event fires right before the character is removed: https://developer.roblox.com/api-reference/event/Player/CharacterRemoving User#20279 0 — 5y

Answer this question