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

Airship FromEulerAnglesXYZ Problem?

So for some reason on click it wont move forward, and in the output it says a Nil value.Help please

the error comes out as this 17:08:41.749 - Workspace.Airship.Panel.Script:9: attempt to call field 'FromEulerAnglesXYZ' (a nil value)

local Lever1 = script.Parent.Lever1
local Lever2 = script.Parent.Lever2
local airship = script.Parent.Parent



function OnClick ()
 
    airship.CFrame=CFrame.FromEulerAnglesXYZ(0,1,30)
end


Lever1.ClickDetector.MouseClick:connect(OnClick)

3 comments

0

its not Cframe, it's CFrame

0

and there's no space after OnClick

0

@HungryJaffer it still says Nil Value in output

1 answer

CFrame.fromEulerAnglesXYZ() not CFrame.FromEulerAnglesXYZ.

Also fromEulerAnglesXYZ takes radians not degrees in it's arguments.

To convert degrees to radians use math.rad(degs)

local Lever1 = script.Parent.Lever1
local Lever2 = script.Parent.Lever2
local airship = script.Parent.Parent



function OnClick ()

    airship.CFrame=CFrame.FromEulerAnglesXYZ(0,math.rad(1),math.rad(30))
end


Lever1.ClickDetector.MouseClick:connect(OnClick)

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