I am trying to make a detector that checks whether a bowling pin is down or not after the player throws their 1st ball. I keep getting the same error every time. This is my code.
local function IsPinDown(pinNumber) local pin = pins:FindFirstChild("Pin"..pinNumber) local rotX,rotZ = math.abs(pin.Rotation.X),math.abs(pin.Rotation.Z) if rotX > 30 or rotZ > 30 then return "IsDown" else return "NotDown" end end
My error is:
Workspace.Model.Model.A2 Machine.Lane2.Touchpart.Script:41: attempt to index nil with 'Rotation'
Please help if possible.