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
Is this in a LocalScript or a ServerScript?
LocalScript
You typed "worldSelect" on line 7 instead of the variable name "wordselect". Dont know if there is another error, though