Well we can use CFrame to do this
If our object is a model use :SetPrimaryPartCFrame() if a basepart then change its CFrame
It will also check if the model has a primarypart so make sure it's set
local thing = workspace.Model
if thing:IsA("BasePart") then
thing.CFrame = thing.CFrame*CFrame.Angles(math.rad(5), 0,0)
elseif thing:IsA("Model") and thing.PrimaryPart~=nil then
thing:SetPrimaryPartCFrame(thing:GetPrimaryPartCFrame()*CFrame.Angles(math.rad(5), 0,0))
end
Now let's combine your script and this one
I will also combine your function and where u call it
script.Parent.ClickDetector.MouseClick:connect(function(plr)
local thing = script.Parent.Lid
if thing:IsA("BasePart") then
thing.CFrame = thing.CFrame*CFrame.Angles(math.rad(5), 0,0)
elseif thing:IsA("Model") and thing.PrimaryPart~=nil then
thing:SetPrimaryPartCFrame(thing:GetPrimaryPartCFrame()*CFrame.Angles(math.rad(5), 0,0))
end
end)