I’ve been attempting to make a skill that makes you freeze midair while holding or charging the skill while also being able to look around. Kinda like Vetex’s games like Arcane Adventure. I’m using OnionDev’s script and altered it a bit, but it gives an error
Local Script:
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Torso = Character:FindFirstChild("Torso")
local RootPart = Character:FindFirstChild("HumanoidRootPart")
local attatch = Instance.new("Attachment", RootPart)
local AlignOrien = Instance.new("AlignOrientation", RootPart)
AlignOrien.Attachment0 = attatch
AlignOrien.Mode = Enum.OrientationAlignmentMode.OneAttachment
local function findTheAngle(positionA, PositionB)
local CFRAME = CFrame.new(positionA, PositionB)
local targetX, targetY, targetZ = CFRAME:ToEulerAnglesXYZ()
local finalAngle = CFrame.Angles(targetX,targetY,targetZ)
return finalAngle
end
local mouse = Player:GetMouse()
local runservice = game:GetService("RunService")
runservice.RenderStepped:Connect(function()
AlignOrien.CFrame = findTheAngle(RootPart.Position, mouse.Hit.Position)
end)