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

Screen Gui tweening but not appearing?

Asked by 4 years ago
local Part = game.Workspace.Shop
local Gui = game.StarterGui.BackpackShopGui.Frame
local TweenService = game:GetService("TweenService")

Gui.Position = UDim2.new(0.25, 0,-1, 0)

Part.Touched:Connect(function(hit)
    local Hit = hit.Parent:FindFirstChild("Humanoid")
    if Hit then
        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
        if player then
            if player.OtherInfo.Backpack.Value < player.OtherInfo.MaxBackpack.Value then
                Gui:TweenPosition(
                    UDim2.new(0.25, 0,0.01, 0),
                    "In",
                    "Sine",
                    1,
                    false
                )
            end
        end
    end
end)

I have this code to pop up a gui window when a player steps on a part but it the explorer it's tweening the gui but when you play the game nothing happens. Any ideas?

1 answer

Log in to vote
0
Answered by 4 years ago

You have to tween the gui in the player.PlayerGui not starter Gui

Ad

Answer this question