"attempt to call a nil value" Error [SOLVED quickly as hell]

Bonjour! I’m working on a GUI script that moves a few frames, TextLabels and an ImageLabel. I’ve tried doing everything from calling it before the script runs to using WaitForChild but it doesn’t work. I’ve even tried looking at other posts but they don’t fix my specific issue. Here is the local script that causes the error:

local lvlTitle = script.Parent.LevelTitle

wait(2)
script.Parent.Dot1:TweenPosition(script.Parent.Dot1.Position - UDim2.new(0.50,0,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
wait(0.05)
script.Parent.Stat1:TweenPosition(script.Parent.Stat1.Position - UDim2.new(0.50,0,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
wait(0.05)
script.Parent.Dot2:TweenPosition(script.Parent.Dot2.Position - UDim2.new(0.50,0,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
wait(0.05)
script.Parent.Stat2:TweenPosition(script.Parent.Stat2.Position - UDim2.new(0.50,0,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
wait(0.05)
script.Parent.Dot3:TweenPosition(script.Parent.Dot3.Position - UDim2.new(0.50,0,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
wait(0.05)
script.Parent.Stat3:TweenPosition(script.Parent.Stat3.Position - UDim2.new(0.50,0,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
wait(0.5)
lvlTitle:TweenPosition(lvlTitle.Position - UDim2.new0(0,0,-0.50,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
script.Parent.ClassImage:TweenPosition(script.Parent.ClassImage.Position - UDim2.new0(0,0,-0.50,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)

And it gives me this error:
Screenshot 2023-04-29 200502
Thank you, sincerely.

1 Like

Can you expand the error message? Like, show a bigger screenshot of it?


It also has this Stack Begin and Stack End thing.

There’s a typo here

1 Like

Okay, I see the mistake, simple spelling error. You put UDim2.new0 it should be UDim2.new

This should be fixed:

local lvlTitle = script.Parent.LevelTitle

wait(2)
script.Parent.Dot1:TweenPosition(script.Parent.Dot1.Position - UDim2.new(0.50,0,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
wait(0.05)
script.Parent.Stat1:TweenPosition(script.Parent.Stat1.Position - UDim2.new(0.50,0,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
wait(0.05)
script.Parent.Dot2:TweenPosition(script.Parent.Dot2.Position - UDim2.new(0.50,0,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
wait(0.05)
script.Parent.Stat2:TweenPosition(script.Parent.Stat2.Position - UDim2.new(0.50,0,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
wait(0.05)
script.Parent.Dot3:TweenPosition(script.Parent.Dot3.Position - UDim2.new(0.50,0,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
wait(0.05)
script.Parent.Stat3:TweenPosition(script.Parent.Stat3.Position - UDim2.new(0.50,0,0,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
wait(0.5)
lvlTitle:TweenPosition(lvlTitle.Position - UDim2.new(0,0,-0.50,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
script.Parent.ClassImage:TweenPosition(script.Parent.ClassImage.Position - UDim2.new(0,0,-0.50,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine,2)
1 Like

Stack Begin and Stack End refers to the “stack trace”, which is shown between them. If you press the error message, you will be taken to the exact line where the error is happening.

1 Like

I really have the worst eyes. Thank you, this was a dumb post.

1 Like

Don’t worry! Everyone misses stuff like this!

1 Like

Dont worry, like @ifkpop said, it happens. Pretty sure even the “best” of programmers still do this sometimes

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.