Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --All credits to baheeg/marzlyn
- --Put the gui in the StarterGui and LocalScript in the StarterPack and the "Value" in the workspace
- -- Made 12/24/14
- --Animations mess up a bit
- --Controls to move are U,H,J,K
- Value= Instance.new("StringValue")
- Value.Parent = game.Workspace
- Value.Name = "Value"
- Value.Value = "nilfornow"
- ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Parent = game.StarterGui
- TextBox = Instance.new("TextBox")
- TextBox.Name = "TextBox"
- TextBox.Cframe(0)(0,0)(0,0)
- TextBox.Text = "Enter player name here"
- TextButton = Instance.new("TextButton")
- TextButton.Name = "TextButton"
- TextButton.Cframe(0)(0.3,0)(0,0)
- TextButton.Text = "Control"
- TheSecondButton = Instance.new("TextButton")
- TheSecondButton.Name = "TheSecondButton"
- TheSecondButton.Cframe(0)(0.41,0)(0,0)
- TheSecondButton.Text = "unAnchor"
- wait(1)
- local selectedplr = nil
- local plr = owner
- local mouse = plr:GetMouse()
- local ismoving = false
- local currentkey = nil
- function controlplr(victim)
- local animation = Instance.new("Animation")
- animation.AnimationId = "http://www.roblox.com/Asset?ID=196043746"
- print(selectedplr)
- if selectedplr == nil then return ("Cannot play function because nil") end
- local animTrack = selectedplr.Character.Humanoid:LoadAnimation(animation)
- if ismoving == true then
- repeat wait(2) animTrack:Play() until ismoving == false
- else
- animTrack:Stop()
- end
- end
- function moveplr(k)
- print(k)
- if k:lower() == "u" or k:lower() == "k" or k:lower() == "h" or k:lower() == "j" then
- if selectedplr~= nil then
- if k:lower() == "u" then
- repeat wait() selectedplr.Character.Torso.CFrame = selectedplr.Character.Torso.CFrame +Vector3.new(1,0,0) until game.Workspace.Value.Value == "nono"
- elseif k:lower() == "h" then
- repeat wait() selectedplr.Character.Torso.CFrame = selectedplr.Character.Torso.CFrame +Vector3.new(0,0,-1) until game.Workspace.Value.Value == "nono"
- elseif k:lower() == "j" then
- repeat wait() selectedplr.Character.Torso.CFrame = selectedplr.Character.Torso.CFrame +Vector3.new(-1,0,0) until game.Workspace.Value.Value == "nono"
- elseif k:lower() == "k" then
- repeat wait() selectedplr.Character.Torso.CFrame = selectedplr.Character.Torso.CFrame +Vector3.new(0,0,1) until game.Workspace.Value.Value == "nono"
- end
- end
- end
- end
- function WaitForMovement(k)
- if k:lower() == "u" or k:lower() == "k" or k:lower() == "h" or k:lower() == "j" then
- game.Workspace.Value.Value = "yesyes"
- ismoving = true
- controlplr()
- else
- ismoving = false
- end
- end
- mouse.KeyDown:connect(WaitForMovement)
- mouse.KeyDown:connect(moveplr)
- function keyno(k)
- ismoving = false
- game.Workspace.Value.Value = "nono"
- end
- mouse.KeyUp:connect(keyno)
- plr.PlayerGui.ScreenGui.TextButton.MouseButton1Down:connect(function(down)
- if plr.PlayerGui.ScreenGui.TextBox.Text == nil then print("There is no text in the textbox!") return end
- print("There is text in the textbox!")
- if game.Players:FindFirstChild(plr.PlayerGui.ScreenGui.TextBox.Text) == nil then print("Player not found") return end
- print("Found")
- print(game.Players:FindFirstChild(plr.PlayerGui.ScreenGui.TextBox.Text))
- selectedplr = game.Players:FindFirstChild(plr.PlayerGui.ScreenGui.TextBox.Text)
- selectedplr.Character.Humanoid.WalkSpeed = 0
- end)
- plr.PlayerGui.ScreenGui.TheSecondButton.MouseButton1Down:connect(function(down)
- print("Checking")
- if selectedplr == nil then return print("Not found! Not unanchored!1!!") end
- print("Not nil")
- selectedplr.Character.Humanoid.WalkSpeed = 15
- print(selectedplr.Character.Humanoid.WalkSpeed)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement