SHOW:
|
|
- or go back to the newest paste.
1 | --All credits to baheeg/marzlyn | |
2 | --Put the gui in the StarterGui and LocalScript in the StarterPack and the "Value" in the workspace | |
3 | -- Made 12/24/14 | |
4 | --Animations mess up a bit | |
5 | --Controls to move are U,H,J,K | |
6 | ||
7 | Value= Instance.new("StringValue") | |
8 | Value.Parent = game.Workspace | |
9 | Value.Name = "Value" | |
10 | Value.Value = "nilfornow" | |
11 | ||
12 | ScreenGui = Instance.new("ScreenGui") | |
13 | ScreenGui.Parent = game.StarterGui | |
14 | ||
15 | TextBox = Instance.new("TextBox") | |
16 | TextBox.Name = "TextBox" | |
17 | TextBox.Cframe(0)(0,0)(0,0) | |
18 | TextBox.Text = "Enter player name here" | |
19 | ||
20 | TextButton = Instance.new("TextButton") | |
21 | TextButton.Name = "TextButton" | |
22 | TextButton.Cframe(0)(0.3,0)(0,0) | |
23 | TextButton.Text = "Control" | |
24 | ||
25 | TheSecondButton = Instance.new("TextButton") | |
26 | TheSecondButton.Name = "TheSecondButton" | |
27 | TheSecondButton.Cframe(0)(0.41,0)(0,0) | |
28 | TheSecondButton.Text = "unAnchor" | |
29 | ||
30 | wait(1) | |
31 | local selectedplr = nil | |
32 | - | local plr = game.Players.LocalPlayer |
32 | + | local plr = owner |
33 | local mouse = plr:GetMouse() | |
34 | local ismoving = false | |
35 | local currentkey = nil | |
36 | function controlplr(victim) | |
37 | local animation = Instance.new("Animation") | |
38 | animation.AnimationId = "http://www.roblox.com/Asset?ID=196043746" | |
39 | print(selectedplr) | |
40 | if selectedplr == nil then return ("Cannot play function because nil") end | |
41 | local animTrack = selectedplr.Character.Humanoid:LoadAnimation(animation) | |
42 | if ismoving == true then | |
43 | repeat wait(2) animTrack:Play() until ismoving == false | |
44 | else | |
45 | animTrack:Stop() | |
46 | end | |
47 | end | |
48 | function moveplr(k) | |
49 | print(k) | |
50 | if k:lower() == "u" or k:lower() == "k" or k:lower() == "h" or k:lower() == "j" then | |
51 | if selectedplr~= nil then | |
52 | if k:lower() == "u" then | |
53 | repeat wait() selectedplr.Character.Torso.CFrame = selectedplr.Character.Torso.CFrame +Vector3.new(1,0,0) until game.Workspace.Value.Value == "nono" | |
54 | elseif k:lower() == "h" then | |
55 | repeat wait() selectedplr.Character.Torso.CFrame = selectedplr.Character.Torso.CFrame +Vector3.new(0,0,-1) until game.Workspace.Value.Value == "nono" | |
56 | elseif k:lower() == "j" then | |
57 | repeat wait() selectedplr.Character.Torso.CFrame = selectedplr.Character.Torso.CFrame +Vector3.new(-1,0,0) until game.Workspace.Value.Value == "nono" | |
58 | elseif k:lower() == "k" then | |
59 | repeat wait() selectedplr.Character.Torso.CFrame = selectedplr.Character.Torso.CFrame +Vector3.new(0,0,1) until game.Workspace.Value.Value == "nono" | |
60 | end | |
61 | end | |
62 | end | |
63 | end | |
64 | function WaitForMovement(k) | |
65 | if k:lower() == "u" or k:lower() == "k" or k:lower() == "h" or k:lower() == "j" then | |
66 | game.Workspace.Value.Value = "yesyes" | |
67 | ismoving = true | |
68 | controlplr() | |
69 | else | |
70 | ismoving = false | |
71 | end | |
72 | end | |
73 | mouse.KeyDown:connect(WaitForMovement) | |
74 | mouse.KeyDown:connect(moveplr) | |
75 | ||
76 | function keyno(k) | |
77 | ismoving = false | |
78 | game.Workspace.Value.Value = "nono" | |
79 | end | |
80 | mouse.KeyUp:connect(keyno) | |
81 | plr.PlayerGui.ScreenGui.TextButton.MouseButton1Down:connect(function(down) | |
82 | if plr.PlayerGui.ScreenGui.TextBox.Text == nil then print("There is no text in the textbox!") return end | |
83 | print("There is text in the textbox!") | |
84 | if game.Players:FindFirstChild(plr.PlayerGui.ScreenGui.TextBox.Text) == nil then print("Player not found") return end | |
85 | print("Found") | |
86 | print(game.Players:FindFirstChild(plr.PlayerGui.ScreenGui.TextBox.Text)) | |
87 | selectedplr = game.Players:FindFirstChild(plr.PlayerGui.ScreenGui.TextBox.Text) | |
88 | selectedplr.Character.Humanoid.WalkSpeed = 0 | |
89 | end) | |
90 | ||
91 | plr.PlayerGui.ScreenGui.TheSecondButton.MouseButton1Down:connect(function(down) | |
92 | print("Checking") | |
93 | if selectedplr == nil then return print("Not found! Not unanchored!1!!") end | |
94 | print("Not nil") | |
95 | selectedplr.Character.Humanoid.WalkSpeed = 15 | |
96 | print(selectedplr.Character.Humanoid.WalkSpeed) | |
97 | end) |