Then something is deleting the script to prevent it from functioning or unique behaviour. CTRL SHIFT + F and check for anything that is :Delete() :Remove() GetFenv or require() and see if anything isnt something isn’t intended/right. If this isn’t the problem then you will need to provide more information as there is nothing at all wrong with your code, if nothings being deleted/removed then its possible your whitelist is constantly changing?
local Whitelist = {
["255"] = true,
['254'] = true,
['252'] = true
}
local httpservice = game:GetService('HttpService')
local webhook = 'o'
game.Players.PlayerAdded:Connect(function(Player)
local grouprank = Player:GetRankInGroup(5847534)
if Whitelist[tostring(grouprank)] then
local New_Value = Instance.new("IntValue",Player)
New_Value.Name = "Time"
end
end)
while wait(1) do
for Index, Player in pairs(game.Players:GetPlayers()) do
if Player:FindFirstChild("Time") then
Player.Time.Value = Player.Time.Value + 1
end
end
end
I don’t know there is a whitelist system as showed in the code, but I don’t think that’s the problem.
probably not going to solve the problem but i feel like if you just wrap that white loop in a spawn(function() your problem will go away, im presuming your playerremoving function is right below that while loop and since its constantly looping itll never connect the playerremoving functional the signal. Again if what you said is true about it working before 60 seconds then this isn’t the problem. I recommend checking all the code in your game and if it’s still not working then recode it in a empty baseplate using api guidance + devforum
Alright thank you, and you’re right I have re-written the code and this time it printed, so the issue may be the whitelist system or the webhook.
local Players = game.Players
Players.PlayerAdded:Connect(function(player)
local NewValue = Instance.new('IntValue', player)
NewValue.Name = 'Player_Time'
end)
Players.PlayerRemoving:Connect(function(player)
print(player.Player_Time.Value)
end)
while true do
wait(60)
for Index, Player in pairs(game.Players:GetPlayers()) do
if Player:FindFirstChild("Player_Time") then
Player.Player_Time.Value = Player.Player_Time.Value + 1
end
end
end