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

My script to make a fighting shedletsky works, only If he can say one thing how can I fix this?

So I am making a shedletsky npc that shoots a laser gun the problem Is where the talking scripts only works If there Is only one phrase there

Script:

local NPC = script.Parent
local phrases = {
	"Get pwnd!"
	"Your gotta duel me? ROLF!!!"
	"Never got PWND, and never will!"
	"ROLF"
	"Man the way imnotaguest1121 programmed me ngl"
	"GG, but I always win!"
	"Hey guys! Shedletsky here and I'm gotta PWND a user!"
	"imnotaguest1121! Buff me!"
	"Shedletsky Is here!"
}

while wait(1) do
	game:GetService("Chat"):Chat(script.Parent.Head, phrases[math.random(1, #phrases)], Enum.ChatColor.White)
end

1 comment

0

This is an easy fix, just add a comma, or semi-colon after each phrase to separate them. You should consider reading about tables: https://developer.roblox.com/en-us/articles/Table

1 answer

Add , or ; after phrases

example:

local phrases = {
    "Get pwnd!",
    "Your gotta duel me? ROLF!!!",
    "Never got PWND, and never will!",
    "ROLF",
    "Man the way imnotaguest1121 programmed me ngl",
    "GG, but I always win!",
    "Hey guys! Shedletsky here and I'm gotta PWND a user!",
    "imnotaguest1121! Buff me!",
    "Shedletsky Is here!"
}

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