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

What is wrong with this Script?

Asked by 9 years ago

I made a simple script that is suppose to make a part spin. it didn't work for some reason which I don't know! The error is: Workspace.Part.Script:3: attempt to perform arithmetic on global 'y' (a nil value) Here is the script it self:

function Spin()
    wait(0.1)
    script.Parent.Rotation = CFrame.Angles(x,y+10,z)
end
while true do
    Spin()
end

1 answer

Log in to vote
1
Answered by 9 years ago
function Spin(x,y,z)
    wait(0.1)
    script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(x,math.rad(y),z)
end
while true do
    Spin(0,1,0)
end
0
This doesn't work for me. vectorxray 5 — 9y
Ad

Answer this question