Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Set prefix here!
- --[[
- VERY OUTDATED: VIEW MY PAGE AND SWITCH TO THE CINIMATIC CAMERA TOOL WITH MORE COMMANDS
- ]]
- local Prefix = ";";
- --[[
- Commands:
- If you have a custom prefix, remember to put it instead of ;!
- tp player/displayname
- follow player/displayname
- view player/displayname
- unview
- unfollow
- ]]
- -- Locals
- local Players = game:GetService("Players");
- local Player = Players.LocalPlayer;
- -- Loop Table
- local looped_Commands = {};
- -- Useless Locals
- local view_Name; -- For console command log
- -- Lower Functions
- local function stc(p1,p2) if string.sub(p1,1,#p2) == string.lower(p2) then return true; end; end; -- String to Command
- -- Main Functions
- local function getPlayer(data)
- local p1 = data:lower();
- for _,p2 in pairs(Players:GetChildren()) do
- local p3 = p2.Name:lower():sub(1,#p1);
- local p4 = p2.DisplayName:lower():sub(1,#p1);
- if p1 == p3 or p1 == p4 then
- return true, p2;
- else
- error("FXAdmin: Player " .. data .. " not found.");
- return false, nil;
- end;
- end;
- end;
- local function Command(data);
- p1 = string.lower(data);
- if stc(p1,prefix .. "tp ") then
- local p2,p3 = getPlayer(string.sub(p1,#(prefix .. "tp ")+1))
- if p2 == true then
- Player.Character.HumanoidRootPart.CFrame = p3.Character.HumanoidRootPart.CFrame;
- return true, "Teleported to " .. p3.Name;
- end;
- elseif stc(p1,prefix .. "follow ") then
- local p2, p3 = getPlayer(string.sub(p1,#(prefix .. "follow ")+1));
- if p2 == true then
- for _,p4 in pairs(looped_Commands) do
- if p4.Type == "Follow" then
- table.remove(looped_Commands,_);
- end;
- end;
- table.insert(looped_Commands, {Type="Follow",Target=p3})
- Player.Character.HumanoidRootPart.CFrame = p3.Character.HumanoidRootPart.CFrame + (p3.Character.HumanoidRootPart.CFrame.lookVector * Vector3.new(-2.5,0,-2.5));
- return true, "Followed " .. p3.Name;
- end;
- elseif stc(p1,prefix .. "unfollow") then
- for _,p2 in pairs(looped_Commands) do
- if p2.Type == "Follow" then
- table.remove(looped_Commands, _);
- return true, "Unfollowed " .. p2.Name;
- end;
- end;
- elseif stc(p1,prefix .. "view ") then
- local p2,p3 = getPlayer(string.sub(p1,#(prefix .. "view ")+1));
- if p2 == true then
- workspace.CurrentCamera.CameraSubject = p3.Character:FindFirstChildOfClass("Humanoid") or p3.Character.HumanoidRootPart or p3.Character:FindFirstChildOfClass("BasePart");
- view_Name = p3.Name
- return true, "Viewed " .. p3.Name;
- end;
- elseif stc(p1,prefix .. "unview") then
- workspace.CurrentCamera.CameraSubject = Player.Character:FindFirstChildOfClass("Humanoid") or Player.Character.HumanoidRootPart or Player.Character:FindFirstChildOfClass("BasePart");
- return true, "Unviewed " .. view_Name;
- else
- error("FXAdmin: Command " .. data .. " not found.");
- return false, nil;
- end;
- end;
- -- Listeners
- Player.Chatted:Connect(function(data)
- local p1,p2 = Command(data) or nil;
- if p1 == true then
- print("FXAdmin: " .. p2);
- end;
- end);
- -- Main Loop
- game:GetService("RunService").Heartbeat:Connect(function(dt)
- for _,p1 in pairs(looped_Commands) do
- if p1.Type == "Follow" then
- if Players:FindFirstChild(p1.Target.Name) or Players:FindFirstChild(p1.Target.DisplayName) then
- Player.Character.HumanoidRootPart.CFrame = p1.Character.HumanoidRootPart.CFrame + (p1.Character.HumanoidRootPart.CFrame.lookVector * Vector3.new(-2.5,0,-2.5));
- end;
- end;
- end;
- end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement