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

GUI Tweening not working in .touched script when second tween is aded?

Asked by 7 years ago
script.Parent.Touched:Connect(function(HIT)
    local player = game.Players:GetPlayerFromCharacter(HIT.Parent)
        player.PlayerGui.ScreenGui.Shop.Visible = true
        local meep = game.Players.LocalPlayer.PlayerGui.ScreenGui.Shop
        meep:TweenPosition(UDim2.new(0.5,0,0.6,0),'In','Sine',0.5)
end)

script.Parent.TouchEnded:Connect(function(HIT)
    local player = game.Players:GetPlayerFromCharacter(HIT.Parent)
    local meep = game.Players.LocalPlayer.PlayerGui.ScreenGui.Shop
    meep:TweenPosition(UDim2.new(1.5,0,0.6,0),'In','Sine',0.5)
        player.PlayerGui.ScreenGui.Shop.Visible = false
end)


the second tween messes everything up.

thisis a local script in a brick

0
Can you please define what exactly is going wrong so we can properly answer the question? CodeLad 31 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

you dont want to the make the gui visible or invisible. Just make it start off of the screen.

script.Parent.Touched:Connect(function(HIT)
    local player = game.Players:GetPlayerFromCharacter(HIT.Parent)
        local meep = game.Players.LocalPlayer.PlayerGui.ScreenGui.Shop
        meep:TweenPosition(UDim2.new(0.5,0,0.6,0),'In','Sine',0.5)
end)

script.Parent.TouchEnded:Connect(function(HIT)
    local player = game.Players:GetPlayerFromCharacter(HIT.Parent)
    local meep = game.Players.LocalPlayer.PlayerGui.ScreenGui.Shop
    meep:TweenPosition(UDim2.new(1.5,0,0.6,0),'In','Sine',0.5)
end)

0
Thanks! User#17125 0 — 7y
0
no problem! MCBombGaming 16 — 7y
Ad

Answer this question