Advertisement
tyridge77

GuilServer

Nov 7th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.53 KB | None | 0 0
  1. wait(1);
  2. local Player = game:GetService("Players").LocalPlayer;
  3. local Mouse = Player:GetMouse();
  4. local PlayerGui = Player.PlayerGui;
  5. local UI = Instance.new("ScreenGui",PlayerGui);
  6. local TextLabel = Instance.new("TextLabel",UI);
  7. TextLabel.BackgroundTransparency = 1;
  8. TextLabel.Text = "Press F to pull";
  9. TextLabel.Size = UDim2.new(.5,0,0.05,0);
  10. TextLabel.Position = UDim2.new(0.25,0,0.85,0);
  11. TextLabel.Font = "ArialBold";
  12. TextLabel.FontSize = "Size18";
  13. TextLabel.TextColor3=Color3.new(1,1,1);
  14. TextLabel.Visible = false;
  15. local Char = Player.Character;
  16. local Cam = Workspace.CurrentCamera;
  17. if game.ReplicatedStorage:FindFirstChild("Guillotine") == nil then
  18.     Guillotine = game.ReplicatedStorage:WaitForChild("gp"):InvokeServer("model",317952382);
  19.     Guillotine.Parent = game.ReplicatedStorage;
  20. end
  21. Guillotine = game.ReplicatedStorage:WaitForChild("Guillotine");
  22. local LocalPull = Guillotine:WaitForChild("Pull"):clone();
  23. LocalPull.Parent = Cam;
  24. LocalPull:SetPrimaryPartCFrame(Guillotine.Pull:GetPrimaryPartCFrame());
  25. local ClickDetector = LocalPull.PullRing;
  26. local RS = game:GetService("ReplicatedStorage");
  27. local sig;
  28. local targ;
  29. if not RS:FindFirstChild("Target") then
  30.     targ = Instance.new("ObjectValue",RS);
  31.     targ.Name = "Target";
  32. end
  33. if not RS:FindFirstChild("Signal") then
  34.     sig = Instance.new("BoolValue",RS);
  35.     sig.Name = "Signal";
  36. end
  37. sig=RS.Signal;
  38. targ=RS.Target;
  39.  
  40. sig.Value=false;
  41. targ.Value=nil;
  42. Mouse.KeyDown:connect(function(k)
  43.     if k == "f" and canpull and targ.Value then
  44.         sig.Value = true;
  45.     end
  46. end)
  47. Player.Chatted:connect(function(m)
  48.     local s = m:lower();
  49.     local found;
  50.     if m == "reset" then
  51.         targ.Value = nil;
  52.         sig.Value = false;
  53.         for _,v in pairs(game.Players:GetPlayers()) do
  54.             RS:WaitForChild("req"):FireServer(317989332,v.Character);
  55.         end
  56.     end
  57.     for _,v in pairs(game.Players:GetPlayers()) do
  58.         if v.Name:lower():sub(1,3)==s:sub(1,3) and not targ.Value then
  59.             local ch = Workspace:WaitForChild(v.Name);
  60.             if ch:FindFirstChild("Torso") and ch:FindFirstChild("HumanoidRootPart") and ch:FindFirstChild("Head") and ch:FindFirstChild("Left Leg")
  61.                 and ch:FindFirstChild("Right Leg") and ch:FindFirstChild("Left Arm") and ch:FindFirstChild("Right Arm")
  62.             then
  63.                 targ.Value=ch
  64.                 found=ch;
  65.             end
  66.         end
  67.     end
  68.     if found then
  69.         for _,v in pairs(game.Players:GetPlayers()) do
  70.             RS:WaitForChild("req"):FireServer(317973613,v.Character);
  71.         end
  72.     end
  73. end)
  74. while true do
  75.     wait(.1);
  76.     canpull = (Char:GetModelCFrame().p-ClickDetector.Position).magnitude < 5;
  77.     TextLabel.Visible = canpull;
  78. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement