#why doesnt the billboardgui update to show the rolls value

53 messages · Page 1 of 1 (latest)

arctic lagoon
#

local players = game:GetService('Players')

players.PlayerAdded:Connect(function(player)

local leaderstats = Instance.new('Folder')
leaderstats.Name = 'leaderstats'
leaderstats.Parent = player


local rolls = Instance.new('IntValue')
rolls.Parent = leaderstats
rolls.Value = 0
rolls.Name = 'Rolls'


local function createBillboardGui(character)

    local head = character:WaitForChild("Head", 5)  

    
    if not head then
        warn("Head not found for player " .. player.Name)
        return
    end

    
    local showrolls = Instance.new('BillboardGui')
    showrolls.Parent = head
    showrolls.StudsOffset = Vector3.new(0, 3, 0)
    showrolls.Adornee = head  
    showrolls.Size = UDim2.new(0, 100, 0, 50)  

    
    local show = Instance.new('TextLabel')
    show.Parent = showrolls
    show.Text = 'Rolls: ' .. tostring(rolls.Value)
    show.BackgroundTransparency = 1
    show.Size = UDim2.new(1, 0, 1)
    show.TextColor3 = Color3.fromRGB(255, 255, 255) 
    show.TextScaled = true  
    show.Font = Enum.Font.PermanentMarker  

    local rolval = rolls.Value
    task.wait(1)
    show.Text = 'Rolls:' ..rolval
    
    rolls.Changed:Connect(function()
        show.Text = 'Rolls: ' .. tostring(rolval) 
    end)
end


player.CharacterAdded:Connect(function(character)
    createBillboardGui(character)
end)


if player.Character then
    createBillboardGui(player.Character)
end

end)

bleak sinew
#

what do you mean

#

it does?

#

o nvm I see

arctic lagoon
#

yh

bleak sinew
#

you are storeing the value in a variabl and each time it changes you update it with the same variable

#

do this

#

rolls.Changed:Connect(function()
show.Text = 'Rolls: ' .. tostring(rolls.Value)
end)

arctic lagoon
#

i tried this before

#

it didnt work

bleak sinew
#

it works for me?

arctic lagoon
#

what

#

do i put it inside the event

#

or outside

bleak sinew
#

put what

arctic lagoon
#

that cofr

#

code

bleak sinew
#

like this

arctic lagoon
#

aight

bleak sinew
#

its the same listner just change the variable in tostring

#

from rolval to rolls.Value

arctic lagoon
#

\ld

#

alr*

#

ty

#

yh bro it still wont work

#

@bleak sinew

bleak sinew
#

.

#

show full code

arctic lagoon
#

local players = game:GetService('Players')

players.PlayerAdded:Connect(function(player)

local leaderstats = Instance.new('Folder')
leaderstats.Name = 'leaderstats'
leaderstats.Parent = player


local rolls = Instance.new('IntValue')
rolls.Parent = leaderstats
rolls.Value = 0
rolls.Name = 'Rolls'


local function createBillboardGui(character)

    local head = character:WaitForChild("Head", 5)  

    
    if not head then
        warn("Head not found for player " .. player.Name)
        return
    end

    
    local showrolls = Instance.new('BillboardGui')
    showrolls.Parent = head
    showrolls.StudsOffset = Vector3.new(0, 3, 0)
    showrolls.Adornee = head  
    showrolls.Size = UDim2.new(0, 100, 0, 50)  

    
    local show = Instance.new('TextLabel')
    show.Parent = showrolls
    show.Text = 'Rolls: ' .. tostring(rolls.Value)
    show.BackgroundTransparency = 1
    show.Size = UDim2.new(1, 0, 1)
    show.TextColor3 = Color3.fromRGB(255, 255, 255) 
    show.TextScaled = true  
    show.Font = Enum.Font.PermanentMarker  

rolls.Changed:Connect(function()
show.Text = 'Rolls: ' ..tostring(rolls.Value)
end)
end

player.CharacterAdded:Connect(function(character)
    createBillboardGui(character)
end)


if player.Character then
    createBillboardGui(player.Character)
end

end)

bleak sinew
#

does it look like this

arctic lagoon
#

yh

bleak sinew
#

bro it works

#

whats the problem?

arctic lagoon
#

for me it dont

bleak sinew
#

did you change the value from the server

arctic lagoon
#

wdym

oblique widgetBOT
#

studio** You are now Level 3! **studio

bleak sinew
#

How did you test if it works or not

arctic lagoon
#

local players = game:GetService('Players')

players.PlayerAdded:Connect(function(player)

local leaderstats = Instance.new('Folder')
leaderstats.Name = 'leaderstats'
leaderstats.Parent = player


local rolls = Instance.new('IntValue')
rolls.Parent = leaderstats
rolls.Value = 0
rolls.Name = 'Rolls'


local function createBillboardGui(character)

    local head = character:WaitForChild("Head", 5)  

    
    if not head then
        warn("Head not found for player " .. player.Name)
        return
    end

    
    local showrolls = Instance.new('BillboardGui')
    showrolls.Parent = head
    showrolls.StudsOffset = Vector3.new(0, 3, 0)
    showrolls.Adornee = head  
    showrolls.Size = UDim2.new(0, 100, 0, 50)  

    
    local show = Instance.new('TextLabel')
    show.Parent = showrolls
    show.Text = 'Rolls: ' .. tostring(rolls.Value)
    show.BackgroundTransparency = 1
    show.Size = UDim2.new(1, 0, 1)
    show.TextColor3 = Color3.fromRGB(255, 255, 255) 
    show.TextScaled = true  
    show.Font = Enum.Font.PermanentMarker  

rolls.Changed:Connect(function()
show.Text = 'Rolls: ' ..tostring(rolls.Value)
end)
end

player.CharacterAdded:Connect(function(character)
    createBillboardGui(character)
end)


if player.Character then
    createBillboardGui(player.Character)
end

end)

bleak sinew
#

like how did you change the value

arctic lagoon
bleak sinew
#

did you change to server view before doing that

arctic lagoon
#

yes

bleak sinew
#

I did the same and it changed

arctic lagoon
#

OHHHHHHHHHHHHHHHHHHH

#

i went into client mode and it changed

bleak sinew
#

.......

arctic lagoon
#

client view*

#

i mean server view

#

ty