Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Text not randomizing when i join the game?

so I want it that when you join the game the text randomizes between certain letters, I have done what should have worked and I see no problems with it but I need help with it

local text = script.Parent.Text
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	text.Value = math.random("A", "B", "C", "D", "E")
end)

1 comment

0

math.random requires a number value

1 answer

✓ Accepted answer

You should be using text.Text and you can only use math.random for numbers.

local text = script.Parent.Text
local Players = game:GetService("Players")
local myLetters = {"A", "B", "C", "D", "E"}

Players.PlayerAdded:Connect(function(player)
    text.Text = math.random(1,#myLetters)
end)

1 comment

0

thank you so much

This discussion is preserved as it was. New answers, comments, and votes are closed.