-
Notifications
You must be signed in to change notification settings - Fork 0
/
main
71 lines (56 loc) · 2.11 KB
/
main
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
rconsoleclear()
rconsolename("Lunar Hub Dev Console")
rconsoleprint("Lunar Admin Started!")
local plrs = game.Players:GetChildren()
local http = game:GetService("HttpService")
local PService = game:GetService("Players")
local prefix = ">"
local player = game.Players.LocalPlayer
function message(msg)
wait()
game.ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer(msg, "All")
end
function findPlayer(target)
for _,v in pairs(game.Players:GetPlayers()) do
rconsoleinfo("Player: " .. v.Name)
if (v.Name:lower():sub(1,#target) == target) then
rconsoleprint("Found Player: " .. v.Name .. "\n")
return v.Name
end
end
return nil
end
function GrabRoot(char)
local rP = char:FindFirstChild('HumanoidRootPart') or char:FindFirstChild('Torso') or char:FindFirstChild('UpperTorso')
return rP
end
for _,Speaker in pairs(plrs) do
Speaker.Chatted:Connect(function(msg)
msg = string.lower(msg)
if (Speaker == player) then
if (msg:sub(1,1) == prefix) then
if (string.lower(msg:sub(2,5)) == "goto") then
local user = msg:sub(7)
if (user ~= nil) then
local plr = findPlayer(user)
if (plr) then
Speaker.Character.HumanoidRootPart.CFrame = PService[plr].Character.HumanoidRootPart.CFrame
message("Teleported!")
end
end
end
if (string.lower(msg:sub(2,7)) == "prefix") then
local newPrefix = msg:sub(9)
local characterCount = #newPrefix
if (characterCount >= 2) then
message("WARNING: Too Many Prefix's!")
else
prefix = newPrefix
wait()
message("Prefix Changed To: " .. prefix)
end
end
end
end
end)
end