UnBuild
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 3233 |
|
|
| 31 Aug 2013 04:54 PM |
Im trying to make the player unable to walk while the tool is selected, without setting their walkspeed to 0, or anchoring their parts.
This works, but if they are walking when they select the tool, they just keep walking
Tool = script.Parent GameGui = Tool.TetrisGui
Tool.Equipped:connect(function(Mouse) Game:GetService("ControllerService"):ClearAllChildren() Mouse.Button1Down:connect(function()
if not Game.Players.LocalPlayer.PlayerGui:FindFirstChild("TetrisGui") then StartingGame = GameGui:Clone() StartingGame.Parent = Game.Players.LocalPlayer.PlayerGui StartingGame.TetrisScript.Disabled = false end
end) end)
Tool.Unequipped:connect(function(Mouse) Instance.new("HumanoidController", Game:GetService("ControllerService"))
if Game.Players.LocalPlayer.PlayerGui:FindFirstChild("TetrisGui") then Game.Players.LocalPlayer.PlayerGui.TetrisGui:Destroy() end
end) |
|
|
| Report Abuse |
|
|
Geomaster
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1480 |
|
|
| 31 Aug 2013 05:00 PM |
Try placing this after the controller is removed:
local p = game.Players.LocalPlayer.Character.Torso.Position game.Players.LocalPlayer.Character.Humanoid:WalkToPoint(p) |
|
|
| Report Abuse |
|
|
UnBuild
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 3233 |
|
|
| 31 Aug 2013 05:01 PM |
| That is a really smart idea, I'll try it, thank you! |
|
|
| Report Abuse |
|
|
UnBuild
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 3233 |
|
|
| 31 Aug 2013 05:05 PM |
qq 17:05:23.148 - Players.Player1.Backpack.Tetris.StartScript:7: attempt to call method 'WalkToPoint' (a userdata value) 17:05:23.156 - Script 'Players.Player1.Backpack.Tetris.StartScript', Line 7 17:05:23.158 - stack end 17:05:23.159 - Disconnected event because of exception
Tool = script.Parent GameGui = Tool.TetrisGui Player = Game.Players.LocalPlayer
Tool.Equipped:connect(function(Mouse) Game:GetService("ControllerService"):ClearAllChildren() Player.Character.Humanoid:WalkToPoint(Player.Character.Torso.Position)
Mouse.Button1Down:connect(function()
if not Player.PlayerGui:FindFirstChild("TetrisGui") then StartingGame = GameGui:Clone() StartingGame.Parent = Player.PlayerGui StartingGame.TetrisScript.Disabled = false end
end) end)
Tool.Unequipped:connect(function(Mouse) Instance.new("HumanoidController", Game:GetService("ControllerService"))
if Player.PlayerGui:FindFirstChild("TetrisGui") then Player.PlayerGui.TetrisGui:Destroy() end
end)
|
|
|
| Report Abuse |
|
|
Geomaster
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1480 |
|
|
| 31 Aug 2013 05:07 PM |
WHOOPS. That is NOT a callable thing. Try:
Player.Character.Humanoid.WalkToPoint = Player.Character.Torso.Position |
|
|
| Report Abuse |
|
|
UnBuild
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 3233 |
|
|
| 31 Aug 2013 05:09 PM |
Oh thanks xP But it doesn't work >.< I'll try setting it to nil maybe? |
|
|
| Report Abuse |
|
|
Geomaster
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1480 |
|
|
| 31 Aug 2013 05:10 PM |
| Or you could try setting their WS to 0 |
|
|
| Report Abuse |
|
|
UnBuild
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 3233 |
|
|
| 31 Aug 2013 05:11 PM |
| "Im trying to make the player unable to walk while the tool is selected, without setting their walkspeed to 0, or anchoring their parts." |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
| |
|
Geomaster
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1480 |
|
|
| 31 Aug 2013 05:12 PM |
I'm bad at reading, but I can kinda see how that works
The humanoid's wonky, but I think that there's something in the wiki that waits until no Keyboard input is detected before it removes controller |
|
|
| Report Abuse |
|
|
UnBuild
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 3233 |
|
|
| 31 Aug 2013 05:15 PM |
Well I need for them the stop where they are and not be able to move while the tool is selected, so I can't just wait for no keyboard input
@Zack I tried, it errored |
|
|
| Report Abuse |
|
|
|
| 31 Aug 2013 05:15 PM |
| Using :MoveTo() on the humanoid requires the use of the second argument. |
|
|
| Report Abuse |
|
|
UnBuild
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 3233 |
|
|
| 31 Aug 2013 05:16 PM |
Can you give me a example?
Player.Character.Humanoid:MoveTo(Player.Character.Torso.Position, ???) |
|
|
| Report Abuse |
|
|
UnBuild
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 3233 |
|
|
| 31 Aug 2013 05:32 PM |
Player.Character.Humanoid:MoveTo(Player.Character.Torso.Position, Player.Character.Torso)
Still doesn't work though |
|
|
| Report Abuse |
|
|
bohdan77
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 7944 |
|
|
| 31 Aug 2013 05:47 PM |
| Just make sure no keys are being pressed, and just wait until none are. |
|
|
| Report Abuse |
|
|
UnBuild
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 3233 |
|
|
| 31 Aug 2013 05:50 PM |
| Then they could select the tool and be moving |
|
|
| Report Abuse |
|
|