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

I need help with tweening multiple frames in one script, am stumped?

Im trying to tween multiple frames in one script to the same position, i finished the script, didn't work(not surprised), but I got no errors. Little stumped. Any tips?

local RobuxFrame =script.Parent.Parent.RobuxFrame
local MainFrame=script.Parent.Parent.MainFrame
local MedicineFrame=script.Parent.Parent.MedicineFrame
local ArmorFrame=script.Parent.Parent.ArmorFrame
local UpgradeFrame =script.Parent.Parent.UpgradeFrame
local WeaponFrame=script.Parent.Parent.WeaponFrame


script.Parent.MouseButton1Click:connect(function()
	
	RobuxFrame:TweenPosition(UDim2.new(0, 250, 0, 15),'Out', 'Bounce', 1.5)	
	MainFrame:TweenPosition(UDim2.new(0, 250, 0, 15),'Out', 'Bounce', 1.5)	
	MedicineFrame:TweenPosition(UDim2.new(0, 250, 0, 15),'Out', 'Bounce', 1.5)	
	ArmorFrame:TweenPosition(UDim2.new(0, 250, 0, 15),'Out', 'Bounce', 1.5)	
	UpgradeFrame:TweenPosition(UDim2.new(0, 250, 0, 15),'Out', 'Bounce', 1.5)	
	WeaponFrame:TweenPosition(UDim2.new(0, 250, 0, 15),'Out', 'Bounce', 1.5)	
	
	
end)

2 comments

0

I can't really find a mistake, you're doing everything good with tweening. From what I see here you can only try adding :WaitForChild("RobuxFrame") and same for all the frames you wanna tween. Maybe that's the problem but the tweening part is good.

0

Thanks for the feed back guys i did that but still didn't seem to work. For the frames I made them visible, i dont know if I have to define that in the script though. I also did some print("It got pas this part") stuff in between in the script. and it seems its not getting past the script.Parent.MouseButton1Click:connect(function()

1 answer

Honestly, it looks like it should work. What mode did you test it in, studio or roblox? Try adding WaitForChild's instead of what you did for variables ie:

local RobuxFrame =script.Parent.Parent:WaitForChild("RobuxFrame")
local MainFrame=script.Parent.Parent:WaitForChild("MainFrame")
local MedicineFrame=script.Parent.Parent:WaitForChild("MedicineFrame")
local ArmorFrame=script.Parent.Parent:WaitForChild("ArmorFrame")
local UpgradeFrame =script.Parent.Parent:WaitForChild("UpgradeFrame")
local WeaponFrame=script.Parent.Parent:WaitForChild("WeaponFrame")


script.Parent.MouseButton1Click:connect(function()

    RobuxFrame:TweenPosition(UDim2.new(0, 250, 0, 15),'Out', 'Bounce', 1.5) 
    MainFrame:TweenPosition(UDim2.new(0, 250, 0, 15),'Out', 'Bounce', 1.5)  
    MedicineFrame:TweenPosition(UDim2.new(0, 250, 0, 15),'Out', 'Bounce', 1.5)  
    ArmorFrame:TweenPosition(UDim2.new(0, 250, 0, 15),'Out', 'Bounce', 1.5) 
    UpgradeFrame:TweenPosition(UDim2.new(0, 250, 0, 15),'Out', 'Bounce', 1.5)   
    WeaponFrame:TweenPosition(UDim2.new(0, 250, 0, 15),'Out', 'Bounce', 1.5)    


end)

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