#textlabel script not workiinnggg
36 messages · Page 1 of 1 (latest)
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
local ClanTextLabel = PlayerGui:WaitForChild("ClanTextLabel")
game.Players.PlayerAdded:Connect(function(player)
local randomNum = math.random(1, 100)
local clanAssigned = false
-- Check the random number against the rarity percentages
for _, clan in pairs(clanInfo) do
if randomNum <= clan.rarity and not clanAssigned then
clanAssigned = true
ClanTextLabel.Text = "Clan: " .. clan.name
print("Assigned player to " .. clan.name .. " clan with a rarity of " .. clan.rarity .. "%")
break
end
end
end)```
any errors in console?
no
what is claninfo?
local clanInfo = {
{name = "Imamura", rarity = commonRarity},
{name = "Lemon", rarity = uncommonRarity},
{name = "Kuon", rarity = rareRarity},
{name = "Naruhaya", rarity = veryRareRarity},
{name = "Kunigami", rarity = epicRarity},
{name = "Isagi", rarity = legendaryRarity}
}```
instead of vars as rarity why not try just numbers?
alright
on the textlabel itself
what are the properties of the tex label
put random set of strings as the text in propertys
just so it works
if nothing appears try scaling the text size down
why are you doing a whole process to define the textlabel?
just do script.parent as the textlabel
k changed that
well?
nope