Discord
Login
Community
DARK THEME

How do I open a different tab in a game?

I'm planning on making a link to a YouTube channel in my game's main menu, but I don't know how to open tabs. Can someone help?

The game is Gunventure ( https://microstudio.io/codecat1/gunventure/ ), and the link will be in the top right of the main menu, as you can see. I already got the button there, I just don't know anything about JavaScript or how to integrate it into microScript. Can you tell me how to do that?

its been i while since i messed around with js but this was a nice excercise

onClick = function()
  system.javascript("""
      window.open("https://youtube.com/@example", "_blank");
  """)
  print("done")
end

update = function()
  if mouse.press then
    onClick()
  end
end

basically just change @example to the @username make sure to keep the @ and just put the onClick() into the result of clicking the button.

Thank you

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community