Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I change parts CFrame (rotation, position)?

local Player = game.Players:WaitForChild("MageMasterHD", 10)

wait ()
while true do
	wait ()
	script.Parent:SetPrimaryPartCFrame(Player.Character.UpperTorso.CFrame)
	script.Parent:SetPrimaryPartCFrame(script.Parent:GetPrimaryPartCFrame() * CFrame.fromEulerAnglesXYZ(0,0.1,0))
end

If I remove the positioning part, it will be rotated, but I want it to turn and I want it to be positioned, how do I solve this?

1 answer

ok then,

change script to this maybe

local Player = game.Players:WaitForChild("MageMasterHD", 10)

wait ()
while true do
    wait ()
    script.Parent:SetPrimaryPartCFrame(Player.Character.UpperTorso.CFrame)
    script.Parent:SetPrimaryPartCFrame(script.Parent:GetPrimaryPartCFrame() * CFrame.fromEulerAnglesXYZ(0,0.1,0))
end


to (put this in just a script in StarterPlayer>StarterPlayerScripts) XD

Player = script.Parent.Parent--this is the player(or if you only want it to be you then check for it to be your character name):

Player = script.Parent.Parent

wait ()
if Player.Name = "MageMasterHD" then
while true do
    wait ()
    (model).CFrame = Player.Character.Humanoid.Torso.CFrame
    (model).Orientation = (orientation stuff)
end
end


change (model) to the model:FindPrimary stuff, hope this answers your question :)

Extra credit:

just in case you want to ever teleport a character ONLY use humanoid.Torso, its not actualy ssomething in humanoid its a property actualy that is hidden. :)

example:

character).Humanoid.Torso.CFrame = Vector3.new(x,y,z)

10 comments

0

Im trying to teleport the model to the player

0

easy

0

Is it just a bug or is not there a script? xD

0

i REALY hope this answeres question because i never answered a wuestion before on this account :(

0

You cant set a models orientation and CFrame by script you have to use something like :SetPrimaryPartCFrame

0

oh ok, then you might just have to go through all the parts in the model and no that wont work, omg so sorry i cant d othis too hard :(

0

Ok you can set it by script but no like this: (model).CFrame

0

That's exactly my problem

0

look, im sorry i have to leave, sorry i couldnt solve this, dont give up though!

0

Im sorry, but i do not have that knowledge to give you the answer on how to rotate a model, so sorry.

This discussion is preserved as it was. New answers, comments, and votes are closed.