Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago
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

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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)
0
Im trying to teleport the model to the player MageMasterHD 261 — 5y
0
easy CommanderCaubunsia 126 — 5y
0
Is it just a bug or is not there a script? xD MageMasterHD 261 — 5y
0
i REALY hope this answeres question because i never answered a wuestion before on this account :( CommanderCaubunsia 126 — 5y
View all comments (6 more)
0
You cant set a models orientation and CFrame by script you have to use something like :SetPrimaryPartCFrame MageMasterHD 261 — 5y
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 :( CommanderCaubunsia 126 — 5y
0
Ok you can set it by script but no like this: (model).CFrame MageMasterHD 261 — 5y
0
That's exactly my problem MageMasterHD 261 — 5y
0
look, im sorry i have to leave, sorry i couldnt solve this, dont give up though! CommanderCaubunsia 126 — 5y
0
Im sorry, but i do not have that knowledge to give you the answer on how to rotate a model, so sorry. CommanderCaubunsia 126 — 5y
Ad

Answer this question