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

Gui Local Script Not Working For Some Reason That Is Beyond My Ability?

Asked by 3 years ago
local UserInputService = game:GetService("UserInputService")
local Player = game:GetService("Players").LocalPlayer

UserInputService.InputBegan:Connect(function(Input)
    if Input.KeyCode == Enum.KeyCode.E then
        if script.Parent.Visible == false then
            script.Parent.Visible = true
            script.Parent:TweenPosition(
                UDim2.new(0,0,0.487), -- end position {0, 0},{0.487, 0}
                "Out", -- easing direction
                "Quart", -- easing style
                2,  -- time
                false, -- override?
                nil -- other stuff
            )
        end
        if script.Parent.Visible == true then
            script.Parent:TweenPosition(
                UDim2.new(0,0,0), -- end position {0, 0},{0.487, 0}
                "Out", -- easing direction
                "Quart", -- easing style
                2,  -- time
                false, -- override?
                nil -- other stuff
            )
            script.Parent.Visible = false
        end
    end
end)

i sad, please help.

0
what does the error say in the output? Grazer022 128 — 3y
0
Udim2 needs 4 zeroes, not three. First two are x scale and offset and the other two are y scale and offset. radiant_Light203 1166 — 3y
0
also u should use elseif on line 17 plus answer of radiant_Light203 typhoon1421 22 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

This is foolish this script i'll have to rewrite a script for this poopy fart btw get these fake scripters out of here trying to help people when they know nothing about lua.

local UserInputService = game:GetService("UserInputService")

local Player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()

local Open = false

UserInputService.InputBegan:Connect(function(Input, IsTyping)

    if not IsTyping and Input.KeyCode == Enum.KeyCode.E then

        if Open == false then

            script.Parent.Visible = true

            script.Parent:TweenPosition(UDim2.new(.741, 0,0.394, 0), "Out", "Quart", 2, false, nil)

            wait(2)

            Open = true

        elseif Open == true then

            script.Parent:TweenPosition(UDim2.new(0.013, 0,0.387, 0), "Out", "Quart", 2, false, nil)        

            wait(2)

            script.Parent.Visible = false

            Open = false

        end         

    end

end)
Ad

Answer this question