#help plz

7 messages · Page 1 of 1 (latest)

hexed pewter
hexed pewter
#
local rep = game:GetService("ServerStorage") --You can change this to ServerStorage for more security.
local nametag = rep.NameTag 

game.Players.PlayerAdded:Connect(function(player)
    
    player.CharacterAdded:Connect(function(char)
        task.wait(5)
        local head = char.Head
        local newtext = nametag:Clone()
        local namtext = newtext.NameText
        local ownertext = newtext.OwnerText
        local humanoid = char.Humanoid
        local lvl = player.leaderstats.Level.Value
        
        humanoid.DisplayDistanceType = "None"
        
        newtext.Parent = head
        newtext.Adornee = head
        namtext.Text = lvl .. ". Seviye | " .. player.Name
            
            if player.Name == "notl4rd" or player.Name == "lghvyc" then
            ownertext.Visible = true
            ownertext.Text = "Geliştirici"
            ownertext.TextColor3 = Color3.fromRGB(255, 255, 0)
        end
lvl.Changed:Connect(function(char)
namtext.Text = lvl .. ". Seviye | " .. player.Name
end)
    end)
end)```
#

thats script

worthy crow
# hexed pewter ```local Players = game:GetService("Players") local rep = game:GetService("Serve...

The error is that lvl is set to the Value and not the object that hold it (ObjectValue). This fixed version of that code should work out:

local Players = game:GetService("Players")
local rep = game:GetService("ServerStorage") --You can change this to ServerStorage for more security.
local nametag = rep.NameTag 

game.Players.PlayerAdded:Connect(function(player)

    player.CharacterAdded:Connect(function(char)
        task.wait(5)
        local head = char.Head
        local newtext = nametag:Clone()
        local namtext = newtext.NameText
        local ownertext = newtext.OwnerText
        local humanoid = char.Humanoid
        local lvl = player.leaderstats.Level
        local lvlValue = lvl.Value

        humanoid.DisplayDistanceType = "None"

        newtext.Parent = head
        newtext.Adornee = head
        namtext.Text = lvlValue .. ". Seviye | " .. player.Name

        if player.Name == "notl4rd" or player.Name == "lghvyc" then
            ownertext.Visible = true
            ownertext.Text = "Geliştirici"
            ownertext.TextColor3 = Color3.fromRGB(255, 255, 0)
        end
        lvl.Changed:Connect(function(char)
            namtext.Text = lvlValue .. ". Seviye | " .. player.Name
        end)
    end)
end)

Hope it helps! Let me know if it doesn't.

hexed pewter
#

it says i have 198 lvl in my character