Help with cframe

i dont know much about cframe but i just want my player to go to the left right and up depending where the player is but i keep getting a certain place which i dont want
if you need better explaining just tell me
script:





local uis = game:GetService("UserInputService")

local debounce = false

local cframe1 = CFrame.new(0,23,0)
local cframe2 = CFrame.new(1,0,21)
local cframe3 = CFrame.new(26,0,-1)

uis.InputBegan:Connect(function(input,isTyping)
	
	if isTyping then return end
	if debounce == true  then return end
	if input.KeyCode == Enum.KeyCode.E  and debounce == false  then
		debounce = true
		local plrs = game:GetService("Players")
		local plr = plrs.LocalPlayer
		local char = plr.Character or plr.CharacterAdded:Wait()
		char.HumanoidRootPart.CFrame = cframe1
		wait(1)
		char.HumanoidRootPart.CFrame = cframe2
		wait(1)
		char.HumanoidRootPart.CFrame = cframe3
		wait(2)
		debounce = false

end
	end)

local script in starter pack

When using CFrame.new() you are basically creating a new CFrame Userdata you can use/manipulate to declare positions and orientations for an object. When you want to set the CFrame of an instance based on the one it already has, what you need to do is multiply both of them.

So maybe, what you want to do is multiply the HumanoidRootPart.CFrame * cframe1/2/3.

2 Likes

oh yeahhhhhhhhhhhhhhhhhhhhhhhhhh