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

I don't understand why this doesn't work?

I am making a Murder game, but it's not adding the name. Help?

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


while true do
	script.Parent.Text = "Game starting..."
	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 = (#names)
end

1 comment

0

Why'd I get -1?

1 answer

Try

newname.Text = math.random(1,#names)

And there is no variable "Head" try to be more specific like... game.Players.LocalPlayer.Character.Head

IMPORTANT: If you do use LocalPlayer then it might or might not need to be in local script

And unless there is a script inside called "LocalScript" put script.Disabled

2 comments

0

It does not work.

0

Try that.

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