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

TweenPosition Wont work? {STILL NOT FIXED}

Asked by
Vid_eo 126
8 years ago

This script with tweenposition that I was making to move a GUI when a button is clicked wont work? UPDATED Script: (I didnt show the whole script before)

--Made by club101coolguy

Player = game.Players.LocalPlayer
Button = script.parent
ButtonBacking = script.Parent.Parent:WaitForChild("ButtonBacking")
SnowTeleport = ButtonBacking:WaitForChild("TeleportButton")
SpawnTeleport = ButtonBacking:WaitForChild("TeleportButton2")
TheVisible = false

function Positioning()
    if TheVisible == false then
        ButtonBacking.Visible = true
        SnowTeleport.Visible = true
        SpawnTeleport.Visible = true
        ButtonBacking:TweenPosition(UDim2.new(0, 0, 0.55, 0), "Out", "Quad")
        Button.Text = "Did this work?"
        TheVisible = true
    elseif TheVisible == true then
        ButtonBacking.Visible = false
        SnowTeleport.Visible = false
        SpawnTeleport.Visible = false
        ButtonBacking:TweenPosition(UDim2.new(0, 0, 0.9, 0), "Out", "Quad")
    end
end
Button.MouseButton1Down:connect(Positioning)
0
Looking at your code, the main problem is the Variable 'TheVisible'; You did not create a Variable anywhere named 'TheVisible', so, to Lua, it is taken as a 'nil value', and thus why your code doesn't work, also, please check the Output feature of the Studio 2.0, as it may tell you the error. :) TheeDeathCaster 2368 — 8y
0
He just don't show all of his code, see he didnt declare the variables ButtonBacking, SnowTeleport, SpawnTeleport, Button XToonLinkX123 580 — 8y
0
Taking another look at your code, when the GUIs become not Visible, 'TweenPosition' is transitioning the GUI to the same place, thus why it is not moving (line 13). :) TheeDeathCaster 2368 — 8y
0
I declared the variables, and there were no errors in the output :). Vid_eo 126 — 8y
0
hmm, lemme try to edit it a bit Vid_eo 126 — 8y

Answer this question