-
Notifications
You must be signed in to change notification settings - Fork 0
/
Code
65 lines (56 loc) · 2.05 KB
/
Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
local ContextActionService = game:GetService("ContextActionService")
ContextActionService:BindActionAtPriority("DisablePeriod", function()
return Enum.ContextActionResult.Sink
end, false, Enum.ContextActionPriority.High.Value, Enum.KeyCode.Period)
local cam = workspace.CurrentCamera
local cf
local cfr
local doe = false
local d = false
local function head()
local p = game.Players.LocalPlayer
local c = p.Character or p.CharacterAdded:Wait()
return c:WaitForChild'Head'
end
local function hum()
local p = game.Players.LocalPlayer
local c = p.Character or p.CharacterAdded:Wait()
return c:WaitForChild'HumanoidRootPart'
end
game:GetService('RunService').RenderStepped:Connect(function()
if doe then
cam.CFrame = head().CFrame * cf
end
if d then
cam.CFrame = hum().CFrame * cfr
end
end)
local UIS = game:GetService("UserInputService")
local gs = game:GetService('GuiService')
UIS.InputBegan:Connect(function(key,e)
if not UIS:GetFocusedTextBox() then
if key.KeyCode == Enum.KeyCode.Comma then workspace.CurrentCamera:PanUnits(-1) end
if key.KeyCode == Enum.KeyCode.Period then workspace.CurrentCamera:PanUnits(1) end
if key.KeyCode == Enum.KeyCode.Equals then
local c = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local h = c:WaitForChild'HumanoidRootPart'
h.CFrame = h.CFrame * CFrame.Angles(0,math.rad(180),0)
end
if key.KeyCode == Enum.KeyCode.Minus then
local c = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local h = c:WaitForChild'HumanoidRootPart'
h.CFrame = h.CFrame * CFrame.Angles(0,0,math.rad(180))
end
if key.KeyCode == Enum.KeyCode.F1 then
cf = head().CFrame:ToObjectSpace(cam.CFrame)
doe = not doe
end
if key.KeyCode == Enum.KeyCode.F2 then
cfr = hum().CFrame:ToObjectSpace(cam.CFrame)
d = not d
end
if (key.KeyCode == Enum.KeyCode.LeftControl and UIS:IsKeyDown(Enum.KeyCode.B)) or (key.KeyCode == Enum.KeyCode.B and UIS:IsKeyDown(Enum.KeyCode.LeftControl)) then
gs:SetEmotesMenuOpen(not gs:GetEmotesMenuOpen())
end
end
end)