Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to call random Strings from a Tabel?

Asked by 3 years ago

Im trying to make the player yell random phrases after touching a object like SCP

heres the line i currently use doesnt work at all this is in a server Script

game.Chat:Chat(player.Character.Head, Strings[math.random(1, #Strings)]

heres the Strings

local Strings = {'HELLO COMRAD!', '????? ????????!', '????? ?????? ?? ??????. ???? - ??? ???!', '???? ?????? ???? ?????????!'}
0
Are there any errors in the output? JustinWe12 723 — 3y
0
Try: game:GetService("Chat"):Chat(player.Character.Head, Strings[math.random(1, #Strings)]) | Also, you haven't closed your bracket. ChristianTRPOC 64 — 3y
0
no there were no errors TheMiniMagic_YT 27 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
GetService(_Chat_)_Chat(player.Character.Head, Strings[math.random(1,_

that fixed it

Ad

Answer this question