How to make a leaderstat display a word instead of value

Simple enough, I still do not know how to make it display a word instead.

Script:

Script
local Players = game:GetService("Players")

local function leaderboardSetup(player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player
	
	local Punches = Instance.new("IntValue")
	Punches.Name = "smacked"
	Punches.Value = 0
	Punches.Parent = leaderstats
	
	local Ball = Instance.new("IntValue")
	Ball.Name = "Ball"
	Ball.Value = nil
	Ball.Parent = leaderstats
end

Players.PlayerAdded:Connect(leaderboardSetup)

Could you elaborate more cus there is a lack of context here.

In some games, it would show what type of tool you are holding in the leaderboard instead of numbers

if you want to display a word instead then i suggest you to use "StringValue"

It’d be:

local StringStat = Instance.new("StringValue", leaderstats)
StringStat.Name = "NAME"
StringStat.Value = "TEXT_HERE"

I tried using “Ball.StringValue”, but it didn’t seem to work. How would I be able to use StringValue?

This one gives a new error
 "StringValue is not a valid member of StringValue “Ball” and “Ball is not a valid member of Folder “Players.BlueClothesPerson.leaderstats””

local Players = game:GetService("Players")

local function leaderboardSetup(player)
	local leaderstats = Instance.new("Folder")
	leaderstats.Name = "leaderstats"
	leaderstats.Parent = player

	local Punches = Instance.new("IntValue")
	Punches.Name = "smacked"
	Punches.Value = 0
	Punches.Parent = leaderstats

	local Ball = Instance.new("StringValue")
	Ball.Name = "Ball"
	Ball.Value = "texthere"
	Ball.Parent = leaderstats
end

Players.PlayerAdded:Connect(leaderboardSetup)

image

1 Like

Worked! Now it’s time to figure out what this is

image

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.