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

What is wrong with this Script?

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

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

1 comment

0

This doesn't work for me.

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