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

How would I fix this?

I'm making a really cruddy Murder game, but the name thing doesn't work.

Text

newname.Text = (1,#names)

Someone said this was right but it doesn't work at all, I'd like some help.

Names

names = {"Nick","Kyle","Loucy","Chris","Harry","Mia"}

Full Script


names = {"Nick","Kyle","Loucy","Chris","Harry","Mia"}
msc = script.Parent.Music
Head = game.Players.LocalPlayer.Character.Head

while true do
	script.Parent.Text = "Game starting..."
	msc:Play()
	msc.Volume = 0.5
	wait(10)
	script.LocalScript.Disabled = false
	name = Instance.new("BillboardGui")
	newname = Instance.new("TextLabel")
	newname.Parent = name
	name.Parent = Head
	newname.BackgroundTransparency = 1
	newname.FontSize = "Size24"
	newname.Text = (1,#names)
	msc.Volume = 0.4
	wait(0.1)
	msc.Volume = 0.3
	wait(0.1)
	msc.Volume = 0.2
	wait(0.1)
	msc.Volume = 0.1
	msc:Stop()
end

The script is in a regular script, please tell me if that's wrong.

1 answer

✓ Accepted answer

newname.Text = names[math.random(#names)]

2 comments

0

It works, but I cannot see the billboardgui.

0

You need to Adornee  the GUI and size the GUI and TextLabel.

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