I can't seem to make a msg function
Please help me
function msg()
end m = Instace.new("Message", game.Workspace) m.Text = "Howdy, Y'all!" wait(5) m:Remove()
Lol, I see you're new to scripting. Technically, you're supposed to put your code in a code block and ask what's going wrong and give the output; and not ask for scripts. I'll give you this one, but don't expect people to give you scripts.
function createMessage(text, waitTime) local message = Instance.new("Message", workspace) --creates Message object and puts in in Workspace message.Text = text --sets message text to text value (look on line 1) wait(waitTime) --waits for waitTime --(again, line 1) message:destroy() --destroys message end --The beauty of this function is that you can specify the text and time it will last. createMessage("Howdy, Y'all!", 5) --calls function, you MUST call function, obviously, or nothing will happen
EDIT: I added an explanation because LordDragonZord :I
game.Workspace
you can just type workspace
.function msg() --Keep the code in between function and end. local m = Instace.new("Message", workspace) --workspace is a shortcut for game.Workspace m.Text = "Howdy, Y'all!" wait(5) m:Destroy() --Destroy instead of remove end msg() --Call the function
One lined script; Hard to read
function msg() local m = Instace.new("Message", workspace) m.Text = "Howdy, Y'all!" wait(5) m:Destroy() end msg()
7 lined script; easy to read
function msg() local m = Instace.new("Message", workspace) m.Text = "Howdy, Y'all!" wait(5) m:Destroy() end msg() --7 lined but easy to read.
Hope this helps!