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

Error bad argument #3 to 'Text' (string expected, got nil) How do i fix?

Asked by 5 years ago

im making a dialogue script that changes the dialogue box when an image button is clicked im getting the error in the title

1while true do
2wait(0.1)
3game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.ImageButton.MouseButton1Down:Connect(function()
4local words = {"Test1", "Test2"}
5 
6local wordSelect = words[math.random(1, #words)]
7 game.StarterGui.DialogueGui.Frame.Dialogue.Text = worldSelect
8    end)
9end
0
Is this in a LocalScript or a ServerScript? GeneratedScript 740 — 5y
0
LocalScript thenormalelevator32 26 — 5y
0
You typed "worldSelect" on line 7 instead of the variable name "wordselect". Dont know if there is another error, though Dfzoz 489 — 5y

1 answer

Log in to vote
0
Answered by
Norbunny 555 Moderation Voter
5 years ago

The issue is that you typed "worldSelect" instead of "wordSelect".

1
oh shoot that is whats wrong thenormalelevator32 26 — 5y
0
Classic coder mistake! :) blarp_blurp645 63 — 5y
Ad

Answer this question