-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLagClips.lua
More file actions
55 lines (49 loc) · 1.41 KB
/
LagClips.lua
File metadata and controls
55 lines (49 loc) · 1.41 KB
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
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local wall
local touchingWall = script.Wall
local wallCanCollide
local jumpTimer = 0
local walkTimer = 0
touchingWall.Changed:connect(function()
if touchingWall.Value then
wallCanCollide = touchingWall.Value.CanCollide
else
wallCanCollide = false
end
end)
repeat wait() until game:IsLoaded()
RunService.Stepped:connect(function()
local character = player.Character
local humanoid = character:FindFirstChild("Humanoid")
local HumanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoid and HumanoidRootPart then
if humanoid.Jump then
jumpTimer = 0
else
jumpTimer += 1
end
if humanoid.MoveDirection.Magnitude > 0 then
walkTimer += 1
else
walkTimer = 0
end
touchingWall.Value = wall
local ray = Ray.new(HumanoidRootPart.Position, HumanoidRootPart.CFrame.LookVector)
wall = workspace:FindPartOnRay(ray)
if wall then
if wallCanCollide and jumpTimer > 3 and walkTimer <= 1 then
local touchingWall2 = touchingWall.Value
touchingWall.Value.CanCollide = not touchingWall.Value.CanCollide
wait()
local collisionPcall = pcall(function()
touchingWall.Value.CanCollide = not touchingWall.Value.CanCollide
end)
if not collisionPcall then
touchingWall2.CanCollide = true
end
end
end
end
end)