Дополни скрипт ниже так чтобы когда игрок нажимает на Q он наклоняет голову в левую, а…
- User
Дополни скрипт ниже так чтобы когда игрок нажимает на Q он наклоняет голову в левую, а на E в правую. Доделай скрипт так, чтобы он соответствовал всем правила скрипта ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- StarterGui --
-- Place this into StarterGui or StarterPack -- -- CREDIT -- -- WhoBloxxedWho; for the initial script -- -- DoogleFox; some stuff ripped from his panner script -- -- DuruTeru; shoving it all into this script and then some :) -- -- UPDATE: turned it into r15, made it so you can swim right in water --
repeat wait() until game:GetService("Players").LocalPlayer.Character ~= nil local runService = game:GetService("RunService") local input = game:GetService("UserInputService") local players = game:GetService("Players")
WatchLeft = {allowed = true; activationkey = Enum.KeyCode.Q;} -- lets you move your mouse around in firstperson WatchRight = {allowed = true; activationkey = Enum.KeyCode.E;} -- lets you move your mouse around in firstperson CanViewBody = true -- whether you see your body Sensitivity = 0.2 -- anything higher would make looking up and down harder; recommend anything between 0
1 Smoothness = 0.05 -- recommend anything between 01 FieldOfView = 90 -- fovlocal cam = game.Workspace.CurrentCamera local player = players.LocalPlayer local m = player:GetMouse() m.Icon = "http://www.roblox.com/asset/?id=569021388" -- replaces mouse icon local character = player.Character or player.CharacterAdded:wait() local humanoidpart = character.HumanoidRootPart
local head = character:WaitForChild("Head") local CamPos,TargetCamPos = cam.CoordinateFrame.p,cam.CoordinateFrame.p local AngleX,TargetAngleX = 0,0 local AngleY,TargetAngleY = 0,0
local running = false local freemouse = false
function updatechar()
codefor _, v in pairs(character:GetChildren())do if CanViewBody then if v.Name == 'Head' then v.LocalTransparencyModifier = 1 v.CanCollide = false end else if v:IsA'Part' or v:IsA'UnionOperation' or v:IsA'MeshPart' then v.LocalTransparencyModifier = 1 v.CanCollide = false end end if v:IsA'Accessory' then v:FindFirstChild('Handle').LocalTransparencyModifier = 1 v:FindFirstChild('Handle').CanCollide = false end if v:IsA'Hat' then v:FindFirstChild('Handle').LocalTransparencyModifier = 1 v:FindFirstChild('Handle').CanCollide = false end end - Assistant
Чтобы добавить наклон головы игрока при нажатии на клавиши Q и E, нужно изменить код в функции input.InputBegan:
luainput.InputBegan:connect(function(inputObject) if inputObject.KeyCode == WatchLeft.activationkey then TargetAngleY = TargetAngleY - 30 -- угол наклона влево elseif inputObject.KeyCode == WatchRight.activationkey then TargetAngleY = TargetAngleY + 30 -- угол наклона вправо end end)Добавив эти строки кода, при нажатии на клавишу Q будет происходить наклон головы влево, а при нажатии на клавишу E - вправо.