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

How do you make a brick spin randomly? Script in desc of this

Asked by 10 years ago

By randomly I mean not just spinning right...or left.. I want it spinning all around but not moving from place to place(Staying in the same spot) just spinning randomly,..Hope i explained good enough

I have one script but it spins only models..I need it on one brick and this script only spins one way:/ here it is

l = script.Parent while true do wait(0.1) local h = l:GetChildren() for i = 1, #h do if h[i].Name == "Part" then h[i].CFrame = h[i].CFrame * CFrame.fromEulerAnglesXYZ(0,0,0.1) end end end

1 answer

Log in to vote
0
Answered by 10 years ago

I guess you wanted the script's parent to spin, if no, then remember to include such information:

l = script.Parent 
while true do wait(0.1) 
    l.CFrame = l.CFrame * CFrame.fromEulerAnglesXYZ(0,0,0.1) 
end
Ad

Answer this question