Hello, I am having an error with this block of code:
function game.ReplicatedStorage.Build.OnServerInvoke(Player, Pos, ItemName, counter) local Item = game.ReplicatedStorage.Ores:FindFirstChild(ItemName):Clone() Item.PrimaryPart.CFrame = CFrame.new(Item.PrimaryPart.Position) * CFrame.Angles(0,math.rad(counter),0) return PlaceItem(Player, Pos, Item, counter) end
Basically, this is the server side to a rotation script (whenever you press r a model rotates by 45 degrees). Each model does a have primarypart. So everytime you press r, in the localscript, it increases a value by 45 (counter variable). You can see that I brought over the counter variable on the server invoke. So I tried putting the counter variable into a CFrame.Angles setup, and got the error. I don't know why this is happening as counter is saved as a number variable. Maybe the transition from local to server screwed it up? Any help would be appreciated.
math.rad
expects a num as an argument, not a CFrame.