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 4 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

while true do 
wait(0.1)
game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.ImageButton.MouseButton1Down:Connect(function()
local words = {"Test1", "Test2"}

local wordSelect = words[math.random(1, #words)]
 game.StarterGui.DialogueGui.Frame.Dialogue.Text = worldSelect
    end)
end
0
Is this in a LocalScript or a ServerScript? GeneratedScript 740 — 4y
0
LocalScript thenormalelevator32 26 — 4y
0
You typed "worldSelect" on line 7 instead of the variable name "wordselect". Dont know if there is another error, though Dfzoz 489 — 4y

1 answer

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

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

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

Answer this question