two tutorials | studio lite

Поделиться
HTML-код
  • Опубликовано: 8 фев 2025
  • Camera script 🎥:
    local cam = workspace.CurrentCamera
    local plr = game.Players.LocalPlayer
    local char = plr.Character or plr.CharacterAdded:Wait()
    local hrp = char:WaitForChild("HumanoidRootPart")
    local neck = char:FindFirstChild("Neck", true)
    local y = neck.C0.Y

    game:GetService("RunService").RenderStepped:Connect(function()
    if neck then
    local camDirection = hrp.CFrame:ToObjectSpace(cam.CFrame).LookVector
    neck.C0 = CFrame.new(0, y, 0) * CFrame.Angles(0, -camDirection.X, 0) * CFrame.Angles(camDirection.Y, 0, 0)
    end
    end)
    Sword script 🗡️:
    while wait() do
    if script.Parent.Parent.Name == "Backpack" then
    local Chararacter = script.Parent.Parent.Parent.Character
    if Chararacter then
    local UpperTorso = Chararacter:FindFirstChild("UpperTorso")
    local Weapon = Chararacter:FindFirstChild(script.Parent.Name)
    if UpperTorso and not Weapon then
    local WeaponOnLeg = Instance.new("Model")
    WeaponOnLeg.Name = script.Parent.Name
    WeaponOnLeg.Parent = Chararacter
    Handle = script.Parent.Handle:Clone()
    Handle.Name = "Handle"
    Handle.Parent = WeaponOnLeg
    local LegWeld = Instance.new("Weld")
    LegWeld.Name = "WeldOnLeg"
    LegWeld.Part0 = UpperTorso
    LegWeld.Part1 = Handle
    LegWeld.C0 = CFrame.new(1,-1.42,0.5)
    LegWeld.C0 = LegWeld.C0 * CFrame.fromEulerAnglesXYZ(math.rad(-150),math.rad(-180),-20.5)
    LegWeld.Parent = Handle
    end
    end
    else
    if Handle.Parent then
    Handle.Parent:Destroy()
    end
    end
    end
    Thanks for watching!

Комментарии • 4