Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- OUTDATED
- -- Commands
- -- ;tp username/displayname (teleports you)
- -- ;disableafk (removes afk kick)
- -- ;follow username/displayname (follows them)
- -- ;unfollow (stops following)
- -- ;view username/displayname (views them)
- -- ;unview (unviews)
- -- Variables
- local Players = game:GetService("Players")
- local Player = Players.LocalPlayer
- local StarterGui = game:GetService("StarterGui")
- -- Command Variables
- local follow = false
- local follow_subject = nil
- -- Functions
- function findPlayer(data)
- for _,v in ipairs(Players:GetChildren()) do
- if string.sub(v.Name, 1, #data) == data or string.sub(string.lower(v.Name), 1, #data) == string.lower(data) and not v == Player then
- return v
- elseif string.sub(v.DisplayName, 1, #data) == data or string.sub(string.lower(v.DisplayName), 1, #data) == string.lower(data) and not v == Player then
- return v
- end
- end
- end
- -- Listeners
- Player.Chatted:Connect(function(msg)
- local cmd = string.lower(msg)
- if string.sub(cmd,1,4) == ";tp " then
- local checkValue = findPlayer(string.sub(msg, 5))
- if checkValue ~= nil then
- Player.Character:FindFirstChild("HumanoidRootPart").CFrame = checkValue.Character:FindFirstChild("HumanoidRootPart").CFrame
- end
- elseif string.sub(cmd,1,11) == ";disableafk" then
- for _,v in pairs(getconnections(game:GetService("Players").LocalPlayer.Idled)) do v:Disable() end
- elseif string.sub(cmd,1,8) == ";follow " then
- local checkValue = findPlayer(string.sub(msg, 9))
- if checkValue ~= nil then
- follow = true
- follow_subject = checkValue
- end
- elseif string.sub(cmd,1,10) == ";unfollow" then
- follow = false
- follow_subject = nil
- elseif string.sub(cmd,1,6) == ";view " then
- local checkValue = findPlayer(string.sub(msg,7))
- if checkValue ~= nil then
- game:GetService("Workspace"):FindFirstChild("Camera").CameraSubject = checkValue.Character:FindFirstChild("HumanoidRootPart")
- end
- elseif string.sub(cmd,1,7) == ";unview" then
- game:GetService("Workspace"):FindFirstChild("Camera").CameraSubject = Player.Character:FindFirstChild("Humanoid")
- end
- end)
- -- Loop
- game:GetService("RunService").Heartbeat:Connect(function(dt)
- if Player.Character then
- if follow == true then
- Player.Character:FindFirstChild("HumanoidRootPart").CFrame = follow_subject.Character:FindFirstChild("HumanoidRootPart").CFrame + follow_subject.Character:FindFirstChild("HumanoidRootPart").CFrame.LookVector * Vector3.new(-3,0,-3)
- end
- end
- end)
- StarterGui:SetCore("SendNotification", {
- Title = "FXAdmin",
- Text = "Executed Successfully.",
- Duration = 60,
- Button1 = "Ok",
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement