I sort of made this little welcome menu for my game

I have no idea how to make the play button work, I watched many tutorials and none seem to work.

3 Likes

Hey:)

If you want that to be with some animation, use TweenService.

If not,you could simply change its visible property to false when clicked.

1 Like

make sure “PLAY” is a textbutton

place localscript in the button

do something like this

script.Parent.MouseButton1Click:Connect(function()
--Play your tween here
ScreenGUI.Visible = false
end)
2 Likes

It did not work. I deleted the tween line because I don’t want one.

the problem is that your camera is stuck?

Send us screenshot of this gui in explorer.

I would use tweens for something like that. Here is an example:

script.Parent.MouseButton1Up:Connect(function()
script.Parent.Parent:TweenPosition(UDim2.new(0.5,0,-1.5,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 1)
end)
“script.Parent” would be the play button, and “script.Parent.Parent” would be the frame as a whole.

There’s two options to a close of a frame, tween and just a visibility configure.

Simple visibility configure (NO ANIMATION):

local PlayerGUI = game.Players.Localplayer
Local GUI = PlayerGUI.YourGui
Local Frame = GUI.YourFrame
Local Button = Frame.YourButton

Button.MouseButton1Click:Connect(function()
        Frame.Visible = false
end)

TweenService animation:

local PlayerGUI = game.Players.Localplayer
Local GUI = PlayerGUI.YourGui
Local Frame = GUI.YourFrame
Local Button = Frame.YourButton

Button.MouseButton1Click:Connect(function()
        Frame:TweenPosition(UDim2.new(Frame's Destination Numbers), Enum.EasingDirection.InOut,Enum.EasingStyle.Sine, 1)
end)

Hope this helped.

As also like @2016Richman said, make sure it is a textbutton or a imagebutton or else it will not work.

2 Likes

Since this is one time gui I would rather destroy the it instead of making it invisible. So instead of using this Frame.Visible = false use this GUI:Destroy()

Hey, I am not a scripter so I can’t help you with the play button (the others had some good suggestions to make it work).

But for your GUI, it looks nice but bland. Maybe add some designs that feel like your hotel or maybe logos?

Also since it’s kinda a pop up (since from what I can tell it’s not covering the screen) maybe add an exit button instead of play?

Anyhow, good job.

-Sid

I forgot to mention this earlier. When I join the real game, the gui is to the side, not in the middle. (Don’t mind the background on the pictures)


(In-Game)

(In studio)

its because your gui is scaled as offset,
this plugin right here will fix your problem,
once you open the plugin, just apply scale for size & position every Frame,TextLabel,Buttons,Etc.
you can fix it manually, but just to make stuff easier for you.

Nah, you can just turn off Reset On Spawn.

That’s not really true because gui will exist until players dies. And this game doesn’t look like player is supposed to die so gui will exists forever and cause memory leak.

To fix that set main frame’s AnchorPoint to 0.5, 0.5 and set Position to 0.5, 0, 0.5, 0. As @ayoub50 motioned use AutoScale Lite plugin to convert Size to Scale and at the end add Constraint (also in this plugin) to this frame so it will look the same on every sceen size.

ScreenGui.Visible doesn’t exist.

If you click play, and it tweens off the screen, and if reset on spawn is disabled, the UI is gone forever.

Set the anchor point to 0.5, 0.5, and set the position to 0.5, 0, 0.5, 0. That should make the UI stay in the centre of the screen, if that’s the problem.

That’s not true, I think you don’t know how ResetOnSpawn property works. The gui will exist as long as you don’t destroy it. Try it by yourself if you don’t believe me.

You literally repeat after me…