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

[CFrame] Rotation problem?

Asked by 9 years ago

Im making a part spin around my torso (Or it should) But I keep getting this error VVVV

attempt to multiply a Vector3 with an incompatible value type or nil

Im not sure why because from what I can see it should not a value type or nil.

Any ideas?

GetTable=function(tablename,plr)
            local NewTable={}
            table.foreach(tablename,function(i,v)
                if (v.Plr==plr.userId) then
                    for _,b in pairs(v.PlrTablets) do
                        table.insert(NewTable,b)
                        table.sort(NewTable)
                    end
                end
            end)
            Run.Heartbeat:wait()
            return NewTable
        end,

RotateTablets=function()
            spawn(function()
                for _,plr in pairs(game.Players:GetPlayers()) do
                    local PlayerTablets={}
                    table.foreach((TA.Functions.GetTable(TA.Ranked,plr)),function(i,v)
                        if not (v.Tab) then
                            table.remove(i.PlrTablets,i)
                        else
                            table.insert(PlayerTablets,i)
                        end
                        local SpinParent=plr.Character.Torso.CFrame.p
                        local Radius1 = CFrame.new(0,math.sin(tick()),-3.35-#PlayerTablets)
                        local rad = math.rad(i*(360/#PlayerTablets))
                        local cfr = SpinParent*CFrame.Angles(0,rad,0)*Radius1 -- ERROR HERE
                        local Pos = v.Tab.CFrame.p
                        Pos = Pos:Lerp(cfr.p,.6)
                        v.Tab.CFrame = CFrame.new(Pos) --*v.Tab.CFrame
                        v.Tab.CFrame = v.Tab.CFrame*CFrame.Angles(.1,.1,.1)
                    end)
                end
            end)
        end
0
Thanks for accepting my answer! If it helped you could you please upvote? DewnOracle 115 — 9y

1 answer

Log in to vote
2
Answered by 9 years ago

The variable Radius1 is a CFrame object. You can only multiply numbers together.

Ad

Answer this question