View difference between Paste ID: zybjyd6E and WxJfJ6te
SHOW: | | - or go back to the newest paste.
1
local plr = game:GetService("Players").LocalPlayer
2
local char = plr.Character
3
local hum = char.Humanoid
4
local bot = false
5
game:GetService("UserInputService").InputBegan:Connect(function(k,b)
6
local key = k.KeyCode
7
if b == true then
8
if key == Enum.KeyCode.Z then
9
bot = not bot
10
end
11
end
12
end)
13
game:GetService("RunService").Stepped:Connect(function()
14
if bot == true then
15
for i,v in pairs(char:GetChildren()) do
16
if v:IsA"Part" or v:IsA"MeshPart" then
17
v.CanCollide = false
18
v.Massless = true
19
end
20
end
21
hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown,false)
22
hum:SetStateEnabled(Enum.HumanoidStateType.Freefall,false)
23
hum:SetStateEnabled(Enum.HumanoidStateType.Running,false)
24
hum:ChangeState(Enum.HumanoidStateType.RunningNoPhysics)
25
elseif bot == false then
26
for i,v in pairs(char:GetChildren()) do
27
if v:IsA"Part" or v:IsA"MeshPart" then
28
v.CanCollide = true
29
v.Massless = false
30
end
31
end
32
hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown,true)
33
hum:SetStateEnabled(Enum.HumanoidStateType.Freefall,true)
34
hum:SetStateEnabled(Enum.HumanoidStateType.Running,true)
35
end
36
end)