I’m having trouble setting the Primary Parts CFrame, the error is in the line
script.Parent.PrimaryPart:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(5), 0))
Here’s my Current Script:
local ClickDetector = script.Parent.ClickDetector --> *Click*
local sound = game.Workspace.Bunker.Base.Sound --> Alarm
local Hinge = script.Parent.PrimaryPart --> Explanatory?
local on = false --> Indicating if Alarm is Running
local S_On = script.Parent.Parent.Back.SwitchOn --> Switch On
local S_Off = script.Parent.Parent.Back.SwitchOff --> Switch Off
ClickDetector.MouseClick:Connect(function()
if on == false then
on = true
S_On:Play()
sound.Playing = true
script.Parent.PrimaryPart:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(5), 0))
wait()
else
on = false
S_Off:Play()
sound.Playing = false
script.Parent.PrimaryPart:SetPrimaryPartCFrame(-Hinge.CFrame*CFrame.Angles(0, math.rad(5), 0))
end
end)