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

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

Asked by 7 years ago

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)

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. g1o2r3d4a5n6 350 — 7y
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() AdministrativeFellow 13 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

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)

Ad

Answer this question