Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Simple tweening script for a GUI will not work? Help!

Asked by
Vid_eo 126
7 years ago
Edited 7 years ago

Hey, this GUI that's supposed to tween a shop down wont work. I am aware that I can't close it, but the opening part won't work. Any fixes? I'd say the only possible error would be in the variables, but im pretty sure the variables are correct. Thanks!

local player = game.Players.LocalPlayer
local StarterGui = game.Workspace:WaitForChild("StarterGui")
local ScreenGui1 = StarterGui:WaitForChild("Youtube")
local GUI = ScreenGui1:WaitForChild("Background")
local ScreenGui2 = StarterGui:WaitForChild("ScreenGuia")
local OpenorClose = ScreenGui2:WaitForChild("Openandclose")

OpenorClose.MouseButton1Click:Connect(function()
    GUI:TweenPosition(UDim2.new(0.5, -200,0.5, -150), 'Out', 'Bounce', 1)
end)


  • Clubberoni

Script + Workspace: https://www.dropbox.com/home?preview=scriptwontwork.PNG (thats a second edited version)

0
Invite me on Team Create. Also, link me to the game you publish it at. I can probably fix this. It doesn't seem to be hard at all. Just invite me. KingLoneCat 2642 — 7y
0
Server script correct? You can not use LocalPlayer in a Server Script. Line 2, are you talking about the StarterGui service that clones all Guis to the PlayerGui? StarterGui is not a child of Workspace, it's a child of DataModel (game). Also, you're changing the StarterGui not the PlayerGui. M39a9am3R 3210 — 7y
0
Oooh thanks Vid_eo 126 — 7y
0
Still doesn't work, weird. I did what you said Vid_eo 126 — 7y

Answer this question