-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmadcityMetor.lua
More file actions
121 lines (93 loc) · 4.03 KB
/
madcityMetor.lua
File metadata and controls
121 lines (93 loc) · 4.03 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
tweenSpeed = 500 -- Adjust the speed as desired
function enableNoclip()
local player = game.Players.LocalPlayer
local character = player.Character
-- Check if noclip is already enabled
if character:FindFirstChild("HumanoidRootPart") and character.HumanoidRootPart:FindFirstChild("RootJoint") then
return -- Noclip is already enabled, no need to proceed
end
-- Enable noclip
local rootPart = character:WaitForChild("HumanoidRootPart")
local humanoid = character:WaitForChild("Humanoid")
local rootJoint = Instance.new("Motor6D")
rootJoint.Name = "RootJoint"
rootJoint.Part0 = rootPart
rootJoint.Part1 = nil
rootJoint.C0 = CFrame.new(0, 0, 0)
rootJoint.C1 = CFrame.new(0, 0, 0)
rootJoint.Parent = rootPart
humanoid.PlatformStand = true
end
function disableNoclip()
local player = game.Players.LocalPlayer
local character = player.Character
-- Check if noclip is already disabled
if character:FindFirstChild("HumanoidRootPart") and not character.HumanoidRootPart:FindFirstChild("RootJoint") then
return -- Noclip is already disabled, no need to proceed
end
-- Disable noclip
local rootPart = character:WaitForChild("HumanoidRootPart")
local humanoid = character:WaitForChild("Humanoid")
rootPart:FindFirstChild("RootJoint"):Destroy()
humanoid.PlatformStand = false
end
function tpUP()
local player = game.Players.LocalPlayer
local humanoidRootPart = player.Character.HumanoidRootPart
local startPosition = humanoidRootPart.CFrame
local endPosition = startPosition + Vector3.new(0, 500, 0) -- Adjust the Y value as needed for desired height
local distance = (endPosition.Position - startPosition.Position).Magnitude
local speed = tweenSpeed -- Adjust the speed as desired
local time = distance / speed
local tweenInfo = TweenInfo.new(time, Enum.EasingStyle.Linear)
local tween = game:GetService("TweenService"):Create(humanoidRootPart, tweenInfo, {
CFrame = endPosition
})
tween:Play()
tween.Completed:Wait()
end
function tp(part)
local player = game.Players.LocalPlayer
local humanoidRootPart = player.Character.HumanoidRootPart
-- Enable noclip
enableNoclip()
-- Tween up to the desired height
tpUP()
-- Tween to a position above the part
local positionAbovePart = part.CFrame + Vector3.new(0, 500, 0) -- Adjust the Y value as needed for desired distance above the part
local distanceAbovePart = (positionAbovePart.Position - humanoidRootPart.Position).Magnitude
local speedAbovePart = tweenSpeed -- Adjust the speed as desired
local timeAbovePart = distanceAbovePart / speedAbovePart
local tweenInfoAbovePart = TweenInfo.new(timeAbovePart, Enum.EasingStyle.Linear)
local tweenAbovePart = game:GetService("TweenService"):Create(humanoidRootPart, tweenInfoAbovePart, {
CFrame = positionAbovePart
})
tweenAbovePart:Play()
tweenAbovePart.Completed:Wait()
-- Disable noclip
disableNoclip()
-- Tween to the part
local distanceToPart = (part.Position - humanoidRootPart.Position).Magnitude
local speedToPart = tweenSpeed -- Adjust the speed as desired
local timeToPart = distanceToPart / speedToPart
local tweenInfoToPart = TweenInfo.new(timeToPart, Enum.EasingStyle.Linear)
local tweenToPart = game:GetService("TweenService"):Create(humanoidRootPart, tweenInfoToPart, {
CFrame = part.CFrame
})
tweenToPart:Play()
tweenToPart.Completed:Wait()
end
for i, part in ipairs(workspace.PiggyEvent:GetChildren()) do
if part.Name == 'Meteor' and part.Meteorsplit:FindFirstChild('Crystal') then
local crystal = part.Meteorsplit.Crystal
tp(crystal)
repeat
mouse1click()
task.wait()
until not part.Meteorsplit:FindFirstChild('CanBeDamaged')
repeat
game:GetService("VirtualInputManager"):SendKeyEvent(true, Enum.KeyCode.E, false, game)
task.wait(0.1)
until not part.Meteorsplit:FindFirstChild('Crystal')
end
end