Players.PlayerRemoving:Connect(function()
local TeamPart1 = game.Workspace.TeamParts.TeamPart1
local Attribute = TeamPart1:GetAttribute("Leader")
if Attribute == 1477309404 then
print("YES")
else
print("NO")
end
end)
I have such a function and it should output “YES” since the attribute value matches the digit(1477309404), but this does not happen. I do not know why this is happening, please tell me.
I’m sorry if it’s written strangely or incorrectly, I use a translator because I don’t know English.
Is it printing that when a player is getting removed from the game, or are you printing “YES” or “NO” in another part of this script or any other script?
Try printing this here:
Players.PlayerRemoving:Connect(function()
print("player left game")
local TeamPart1 = game.Workspace.TeamParts.TeamPart1
local Attribute = TeamPart1:GetAttribute("Leader")
print(Attribute) -- tells you what the variable actually is because if it's nil then it would print NO in the code below
--[[if Attribute == 1477309404 then
print("YES")
else
print("NO")
end]]
end)
Players.PlayerRemoving:Connect(function()
local TeamPart1 = game.Workspace.TeamParts.TeamPart1
local Attribute = TeamPart1:GetAttribute("Leader")
if tonumber(Attribute) == 1477309404 then
print("YES")
else
print("NO")
end
end)
If this does not work then you have something wrong in either the creation of the Attribute or you never update it.