Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

you hit tween only works 1 time, you hit more, it does not tween no more Whats 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)
	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

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.