-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplatform.lua
81 lines (75 loc) · 2.06 KB
/
platform.lua
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
-- yes i stole this from IY but its open source anyway so cry about it lmfao
-- up: E
-- down: Q
-- toggle platform = G
IYMouse = game.Players.LocalPlayer:GetMouse()
local function getRoot(char)
local rootPart = char:FindFirstChild('HumanoidRootPart')
return rootPart
end
local floatActive = false
local function platform(speaker)
local pchar = speaker.Character
if pchar and not pchar:FindFirstChild("floatName") then
task.spawn(function()
local Float = Instance.new('Part')
Float.Name = "floatName"
Float.Parent = pchar
Float.Transparency = 0.8
Float.Size = Vector3.new(2,0.2,1.5)
Float.Anchored = true
local FloatValue = -3.097
Float.CFrame = getRoot(pchar).CFrame * CFrame.new(0,FloatValue,0)
qUp = IYMouse.KeyUp:Connect(function(KEY)
if KEY == 'q' then
FloatValue = FloatValue + 0.5
end
end)
eUp = IYMouse.KeyUp:Connect(function(KEY)
if KEY == 'e' then
FloatValue = FloatValue - 0.5
end
end)
qDown = IYMouse.KeyDown:Connect(function(KEY)
if KEY == 'q' then
FloatValue = FloatValue - 0.5
end
end)
eDown = IYMouse.KeyDown:Connect(function(KEY)
if KEY == 'e' then
FloatValue = FloatValue + 0.5
end
end)
floatDied = speaker.Character:FindFirstChildOfClass('Humanoid').Died:Connect(function()
FloatingFunc:Disconnect()
Float:Destroy()
qUp:Disconnect()
eUp:Disconnect()
qDown:Disconnect()
eDown:Disconnect()
floatDied:Disconnect()
end)
local function FloatPadLoop()
if pchar:FindFirstChild("floatName") and getRoot(pchar) and floatActive then
Float.CFrame = getRoot(pchar).CFrame * CFrame.new(0,FloatValue,0)
else
FloatingFunc:Disconnect()
Float:Destroy()
qUp:Disconnect()
eUp:Disconnect()
qDown:Disconnect()
eDown:Disconnect()
floatDied:Disconnect()
end
end
FloatingFunc = game:GetService("RunService").Heartbeat:Connect(FloatPadLoop)
end)
end
end
platform(game.Players.LocalPlayer)
warn("loaded")
IYMouse.KeyDown:Connect(function(KEY)
if KEY == 'g' then
floatActive = not floatActive
end
end)