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

GUI Tweening but the GUI is invisible?

So I've been trying to make a shop Gui for quite some time now and while I could easily have it just turn the visible on and off, I like to be fancy and use tweening. Unfortunately whenever I do it makes the shop Gui invisible. To go more in-depth is when I click the button to open the shop, if I select the frame I can see the tween animation happen and see that its where its supposed to be, but I just can't see it physically. It's hard to explain but it does the tween animation and it goes where it's supposed to but its invisible.

Yes I have it set on to be visible and everything but it still is invisible, so some professional help would be nice given I've only been scripting for 3 days.

local frame = game.StarterGui.Shop.Frame
local open = game.StarterGui.Shop.Open
local background = game.StarterGui.Shop.Background

script.Parent.MouseButton1Click:Connect(function()
	if open.Value == false then
		open.Value = true
		frame:TweenPosition(UDim2.new(0.213, 0, 0.17, 0), "Out", 1, true)
		background.Visible = true
	else
		open.Value = false
		frame:TweenPosition(UDim2.new(0.213, 0, 1, 0), "Out", 1, true)
		background.Visible = false
	end
end)

https://imgur.com/a/eBROUlu shows the outline on screen

https://imgur.com/a/WHpZFT9 shows it off screen

1 comment

0

To explain it some more in side of studio or even in a game it seems to take the position it was last at, I.E out of the screen, and stays there. Although when you select it via the explorer you can see the outline of it doing what the script says, the actual physical view of it is stuck to where it was last set to.

1 answer

✓ Accepted answer

Another thing i see A lot of Beginner Gui scripters do.. Use StarterGui instead of PlayerGui Averything that the player sees is in the PlayerGui located in game.Players.PLAYERNAME.PlayerGui

Basically everything in StarterGui is COPIED into PlayerGUI

So instead of saying game.StarterGui... say game.Players.LocalPLayer.PlayerGui

Use this instead:

local player = game.Players.LocalPlayer
local playerGui = player.PlayerGui
local frame = playerGui.Shop.Frame
local open = playerGui.Shop.Open
local background = playerGui.Shop.Background

1 comment

0

And make sure your Shop System is Exploit proof.. And FilteringEnabled-Friendly.

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