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?