#how to get orientation of CFrame and give it to server

91 messages · Page 1 of 1 (latest)

pure bobcat
#

fr i don't know what to do lol

lethal wagon
#

just send the cframe

#

not just position

pure bobcat
#

nvm

#

forgot about it

#

i has another problem

#

why i can't just

#

send model from local script to server?

lethal wagon
#

because

#

the model doesnt exist on server

#

only on client

#

how can it receive something

#

that doesnt exist

#

in reality

pure bobcat
#

roblox does not allow me to get with CFrame orientation and does not allow me to forward the object to the server, what the hell

lethal wagon
#

?

#

send code

#

client and server

pure bobcat
#

i changed code to another

lethal wagon
#

:FireServer(Model:GetPivot())

#

and on server

#

u get the cframe

#

and create the model

#

and

#

NewDoor:PivotTo(cframeReceived)

pure bobcat
#

yeah i tested it, it also not worked i will try again

#

getpivot and pivotto , SetPrimaryPartCFrame etc not works

#

i will try again.

lethal wagon
#

Setprimarypartcframe is deprecated

#

use pivotto

pure bobcat
#

@lethal wagon

lethal wagon
#

code

pure bobcat
#

one sec

#
--server
game.ReplicatedStorage.Build.OnServerEvent:Connect(function(plr,nam,cfr)
    local moddel = game.ReplicatedStorage.Buildings:FindFirstChild(nam):Clone()
    
    moddel:PivotTo(cfr)
    
    moddel.Parent = game.Workspace
    
end)
lethal wagon
#

bruh

#

is this the rotation?

pure bobcat
#
--client
local UIS = game:GetService("UserInputService")

script.Parent.MouseButton1Click:Connect(function()

    local Plr = game.Players.LocalPlayer
    
    local mouse = Plr:GetMouse()
    
    local Model = game.ReplicatedStorage.Buildings:FindFirstChild(script.Parent.Parent.Name)
    if Model then
        Model = Model:Clone()
        Model.Name = Model.Name.."' Build"
        Model.Parent = game.Workspace
    else
        warn("Model not found")
    end
    
mouse.Move:Connect(function()
         m = game.Workspace:FindFirstChild(Model.Name)
        if m ~= nil then
                mouse.TargetFilter = m
                 hitPosition = mouse.Hit.p
                m:SetPrimaryPartCFrame(CFrame.new(hitPosition))
                
        end
end)

UIS.InputBegan:Connect(function(input,chat)
    if input.KeyCode == Enum.KeyCode.R and chat == false then
        
            m.PrimaryPart.CFrame *= CFrame.Angles(0,-45,0)
            m:SetPrimaryPartCFrame(CFrame.new(hitPosition))
    end
end)

    mouse.Button1Down:Connect(function()
        game.ReplicatedStorage.Build:FireServer(script.Parent.Parent.Name,Model:GetPivot())
    end)
    
    script.Parent.Parent.Parent.Parent.TextButton.MouseButton1Click:Connect(function()

        Model:Destroy()

    end)
end)
pure bobcat
lethal wagon
#

m:PivotTo(m:GetPivot() * CFrame.Angles(0, math.rad(-45), 0))?

#

why are u checking

#

PrimaryPart cframe

#

ur not setting the models orientation

#

only the primary part

pure bobcat
#

I've never tried to rotate models, so it was written by a chatgpt

lethal wagon
#

💀

pure bobcat
#

idk how to rotate model, i tried to just use "Orientation" but its says nil

pure bobcat
#

ok one sec

#

not works

lethal wagon
#

code

pure bobcat
#

oh nvm

#

i just deleted :SetPrimaryPartCFrame

#

Thanks alot.

lethal wagon
#

np

pure bobcat
#

now I will know how to rotate the models

lethal wagon
#

good

pure bobcat
#

btw

#

can you please help with this thing

lethal wagon
#

with what

pure bobcat
#

I want so door

#

should be only horizontal

lethal wagon
#

wym

pure bobcat
#

Well, that is, as you can see, the door looks in the direction where the player's mouse is pointing

lethal wagon
#

yea

pure bobcat
#

I want the door to be on a horizontal plane.

lethal wagon
#

ur still using SetPrimaryPartCFrame for this

lethal wagon
#

coudl u record whats happening cuz the image is weird

pure bobcat
#

i using PivotTo

lethal wagon
#

send code

pure bobcat
#

lol nvm i fixed it just by PivotTo(CFrame.New(hitposition))

#

also thanks for fast reply

lethal wagon
#

JUST SAID THAT

lethal wagon
pure bobcat
#

look

lethal wagon
#

YES?

#

THATS WHAT I TOLD U TO DO

#

and said

#

ur using SetPrimaryPartCFrame

#

u said

#

"nope"

pure bobcat
#

well, in general, it doesn't matter anymore, the main thing is that everything has been fixed.

lethal wagon
#

nice