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

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

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

3 comments

0

Is this in a LocalScript or a ServerScript?

0

LocalScript

0

You typed "worldSelect" on line 7 instead of the variable name "wordselect". Dont know if there is another error, though

1 answer

✓ Accepted answer

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

2 comments

1

oh shoot that is whats wrong

0

Classic coder mistake! :)

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