Gooey Error (SOLVED)

I’m trying to use Gooey library for my game. Everything going well when in main menu. But i got this error when i use it in battle stage.

ERROR:SCRIPT: /gooey/internal/core.lua:87: attempt to call global ‘type’ (a number value)
stack traceback:
/gooey/internal/core.lua:87: in function ‘to_hash’
/gooey/internal/button.lua:18: in function ‘button’
/gooey/gooey.lua:71: in function ‘button’
/main/scripts/gui/battle.gui_script:377: in function ‘fn’
/gooey/gooey.lua:165: in function ‘group’
/main/scripts/gui/battle.gui_script:376: in function </main/scripts/gui/battle.gui_script:369>

My code for initialize the button :

local gooey = require "gooey.themes.kenneyblue.kenneyblue"
function on_input(self, action_id, action)
	if not self.game_paused then
		return true
	end
	if action_id == hash("touch") and action.pressed then
		sound.play("#mouse_click")
	end
	gooey.button("restart_button",action_id, action, function(button)
		if self.game_finish or self.game_paused then
			msg.post("default:/battle_gui", "hide")
			sound.stop("#vic")
			msg.post("default:/arena", "restart_game")
		end
	end
end

Anyone know how to fix it ?

It’s this line:

This indicates that you somewhere in your code have replaced the built in type() function with a number. Search your code for an assignment similar to:

type = 1234
3 Likes

Thank you it’s fixed now.

It’s true that i have so many assignment as you said, so i need to change that all. After all thank you so much for the answer.

It’s also an indication that you are using global variables. My recommendation is to avoid this at all costs to avoid similar problems in the future.

Ok. I’ll keep in mind that. Thank you.