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

Attemp to call method 'TweenPosition' (a nil value) ??

Asked by 5 years ago

Whenever i execute the script the output would say " attempt to call method 'TweenPosition' (a nil value)"

--//Variable Getting || Setting
local button = script.Parent.Frame.Play
local size = 30 --//Size Of Blur || How strong it is
local blur = Instance.new("BlurEffect")
local Frame = script.Parent.Frame
local Music = game.Workspace.LobbyMusic
local Logo = script.Parent.Frame.ImageLabel
local Name = script.Parent.Frame.Name
local V = script.Parent.Frame.Version

--// Logo
while true do
        for i = 1, 360 do
        Logo.Rotation = i/.090
        wait()
        if Logo.Rotation == 720 then
        Logo:TweenPosition(UDim2.new(-1, -55,0.5, -55), "Out", "Quad")
        wait(2)
        Name:TweenPosition(UDim2.new(0.45, -271,0.374, -25), "Out", "Quad", 1)
        end
    end
end

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

It’s because when you do local Name = script.Parent.Frame.Name, you’re actually referencing the actual name of the frame, which cannot be tweened.

You could fix this by either naming the ‘Name’ guiobject something else, or doing script.Parent.Frame[“Name”] to reference the instance.

Ad
Log in to vote
0
Answered by 5 years ago

Since "Name" is a child of the Frame, when running the line:

local Name = script.Parent.Frame.Name

You are calling the Name Property of Frame, (which is a nil value since the tween cant move a name) so just change the actual name of "Name" to something else and reapply it to the script, such as:

local Name = script.Parent.Frame.TextLabel

Answer this question