#GetAttributeChangedSignal not working

1 messages · Page 1 of 1 (latest)

velvet wagon
#

Server:

#
    plr.CharacterAdded:Connect(function(char)
        local hum = char:WaitForChild("Humanoid")
        hum:SetAttribute("InLobby", false)
        
        
        
        hum:GetAttributeChangedSignal("InLobby"):Connect(function()
            if hum:GetAttribute("InLobby") then
                print("Player is currently in a lobby.")
                
                
            elseif not hum:GetAttribute("InLobby") then
                print("Player is not in a lobby.")
                
                
            end    
        end)
    end)
end) ```
#

Local:

#
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local leaveGui = player:WaitForChild("PlayerGui"):WaitForChild("LeaveGui")

leaveGui.Frame.LeaveButton.MouseButton1Click:Connect(function()
    hum:SetAttribute("InLobby", false)
end)
#

It is supposed to print either "Player in lobby" or "player not in"

#

but doesnt

eager raft
#

Idk but in ur server youre using get attribute changed signal. Which you never get the signal since you set it above the line