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

you hit tween only works 1 time, you hit more, it does not tween no more Whats wrong?

Asked by 3 years ago
local parent = script.Parent
parent.Touched:Connect(function(touchedpart)
    local player = touchedpart.Parent
    local playerservice = game:GetService("Players")
    local playergui = playerservice:FindFirstChild(player.Name).PlayerGui
    local Property = playergui.SHOP.Frame
    wait(0.5)
    Property:TweenSizeAndPosition(UDim2.new(0.052, 0,0.081, 0), UDim2.new(0,0,0,0)

    )
    wait(0.2)
    game.ReplicatedStorage.coin:Play()
end)

1 answer

Log in to vote
0
Answered by 3 years ago

You haven't moved back the frame after the animation so it keeps tweening it without you actually seeing it. At least that's my guess. Correct me if I'm wrong.

local parent = script.Parent
parent.Touched:Connect(function(touchedpart)
    local player = touchedpart.Parent
    local playerservice = game:GetService("Players")
    local playergui = playerservice:FindFirstChild(player.Name).PlayerGui
    local Property = playergui.SHOP.Frame
    wait(0.5)
    if Property.Position == UDim2.new(0.052, 0,0.081, 0)
        Property:TweenSizeAndPosition(PleaseChangeThisAndPutWhateverYouWant)
    end
    Property:TweenSizeAndPosition(UDim2.new(0.052, 0,0.081, 0), UDim2.new(0,0,0,0))
    wait(0.2)
    game.ReplicatedStorage.coin:Play()
end)
Ad

Answer this question