Hello there users of devforum. I have come across a problem with my script of the model not being orientated right.
I have attempted to use math.deg, CFrame.angles or even just typing another TranslateBy but using math.deg. Yet none of these have worked so help would be great.
Im not showing the full script but it should be somewhere here.
if InsideCC == false then
InsideCC = true
if msg == "scp-2521" or "SCP-2521" or "2521" or "SCP 2521" or "scp 2521" then
local char = player.Character
local hrp = char:WaitForChild("HumanoidRootPart")
if hrp and char then
hrp.Anchored = true
local clonedmodel = SCP2521:Clone()
clonedmodel.Parent = workspace
clonedmodel:SetPrimaryPartCFrame(hrp.CFrame)
clonedmodel:TranslateBy(Vector3.new(2, 0, 2))
else
brick.Touched:Disconnect(function()
InsideCC = false
just use SetPrimaryPart with a cframe that’s offset with a rotation
e.g., :SetPrimaryPartCFrame(Part.CFrame * CFrame.new(0,0, -16) * CFrame.Angles(0, math.rad(30), 0) + Vector3.new(0, 15, 0))
this makes a cframe that’s 16 studs in front of Part, then rotates it 30 degrees to (I think) the left, then offsets it by 15 studs upwards globally
I see a few other issues in your code, like your boolean expression on the 3rd line not using or correctly, you putting arguments into :Disconnect that doesn’t take arguments, you checking if char exists after using :WaitForChild on it
no, in your case, you’d use the player’s humanoidRootPart’s cframe and offset that cframe to get the cframe you’d put into :SetPrimaryPartCFrame
This bit is the bit that handles rotation, so mess around with the X Y and Z numbers in there until it is oriented correctly. They are all in radians, the function math.rad(30) converts 30 degrees into radians.
That’s not what or does. or allows you to check multiple expressions, it doesn’t allow you to compare multiple things to a single value. You need to re-write it like so:
if msg == "scp-2521" or msg == "SCP-2521" or msg == "2521" or msg =="SCP 2521" ...
It can also save you a little time if you use string.lower to ignore capitals:
if msg:lower()=="scp-2521" or msg:lower() == "scp 2521" or msg == "2521" then