generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How to disable movement in a player?

Previous Thread :: Next Thread 
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
27 Apr 2016 12:42 PM
no idea
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
27 Apr 2016 12:43 PM
btw, I don't mean WalkSpeed, I mean movement as in when you press W, it doesn't actually go forward even tho your speed is 16.
Report Abuse
RightLegRed is not online. RightLegRed
Joined: 02 Oct 2009
Total Posts: 6761
27 Apr 2016 12:44 PM
Have you tried setting the humanoids walkspeed to 0?
Report Abuse
RightLegRed is not online. RightLegRed
Joined: 02 Oct 2009
Total Posts: 6761
27 Apr 2016 12:45 PM
Sorry, hit reply before your second post! You could attempt what is listed here:

http://wiki.roblox.com/index.php?title=Controlling_a_Player%27s_Character
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
27 Apr 2016 12:49 PM
Amazing. Thank you a lot, you saved me!!
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
27 Apr 2016 01:39 PM
Does it work for you? I've tried multiple times, but to no avail, it won't stop. If someone could actually give me part of the script I'd be very appreciated!
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
27 Apr 2016 02:01 PM
buuuump
Report Abuse
Dev_Ryan is online. Dev_Ryan
Joined: 10 Mar 2013
Total Posts: 243
27 Apr 2016 02:17 PM
I would just set a .Changed event on the humanoid's walkspeed and check if the player is allowed to walk or not, if not then it sets the speed at 0.

If would be much simpler than getting the WASD keys and checking for key presses and if the player is allowed to walk or not.

Example:

local canWalk = true
local humanoid = -- link to humanoid here
humanoid.Changed:connect(function()
if canWalk then humanoid.WalkSpeed = 20
else humanoid.WalkSpeed = 0 end
end)


Report Abuse
PureConcept is not online. PureConcept
Joined: 15 Feb 2014
Total Posts: 2838
27 Apr 2016 02:23 PM
Disable controlscript


https://www.roblox.com/waifu-item?id=402735026 https://www.roblox.com/finally-item?id=405452153
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
27 Apr 2016 03:02 PM
local plr = game.Players.LocalPlayer
local KeyboardMovement = require(plr:WaitForChild("PlayerScripts"):WaitForChild("ControlScript"):WaitForChild("MasterControl"):WaitForChild("KeyboardMovement"))
wait(2)
KeyboardMovement:Disable()
wait(4)
KeyboardMovement:Enable()

Exactly, this is what I've been doing, however, KeyboardMovement:Enable() kind of glitches, because it sometimes works (when wait(2) it works, but when wait(5) it doesn't.) Plus, when I disable it, the player will keep walking in the same direction.
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
27 Apr 2016 03:04 PM
Dev_Rian, I appreciate your help but I said that my problem isn't WalkSpeed, what I wanna do is to use MoveTo on a player without letting them the chance to fight back.
Report Abuse
brack4712 is not online. brack4712
Joined: 07 Mar 2009
Total Posts: 243
27 Apr 2016 03:05 PM
You could just anchor the torso.
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
27 Apr 2016 03:08 PM
...Anchoring the torso would make the player freeze in place, and the situation would be even worse because it wouldn't even play the Idle animation... I want to use MoveTo, without letting the player the opportunity to fight back!
Report Abuse
TacticalKiller91 is not online. TacticalKiller91
Joined: 28 Jan 2014
Total Posts: 228
27 Apr 2016 03:42 PM
Okay, I've done this before.


What I did was I re-parented the control script located in the playerscripts to a Misc Folder in workspace, which held all of the player scripts. I performed something different to your's but I then re parented it and it's been a long while since I've gone on it, but I think it worked for me. In this case you would re-parent the script, Humanoid:MoveTo(), re-parent the script again.


Good luck.
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
27 Apr 2016 03:51 PM
Tried this:
local plr = game.Players.LocalPlayer
local BParent = plr:WaitForChild("PlayerScripts"):WaitForChild("ControlScript"):WaitForChild("MasterControl"):WaitForChild("KeyboardMovement").Parent
local KeyboardMovement = plr:WaitForChild("PlayerScripts"):WaitForChild("ControlScript"):WaitForChild("MasterControl"):WaitForChild("KeyboardMovement")
print("1")
wait(2)
print("2")
KeyboardMovement.Parent = workspace.Folder
wait(4)
print("3")
KeyboardMovement.Parent = BParent

Doesn't seem to work, hopefully I'm doing something wrong, still, I really appreciate your help! Any other suggestions? :(
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
27 Apr 2016 04:25 PM
bump :S
Report Abuse
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
27 Apr 2016 04:27 PM
local p = game.Players.LocalPlayer
p:WaitForChild("PlayerScripts"):WaitForChild("ControlScript"):Destroy()

The above seems to work for me.
Report Abuse
TacticalKiller91 is not online. TacticalKiller91
Joined: 28 Jan 2014
Total Posts: 228
28 Apr 2016 01:45 PM
Are you performing it from a Local Script? Connect the function an injection script.


Which injects a local script into the Players.
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
28 Apr 2016 02:10 PM
Yes, I am. Injection script? I never heard that. Yet, the other comment helped me, it disables it but not the first time I execute the code, I have to enable/disable it multiple times for it to work.
Report Abuse
Inigo18 is not online. Inigo18
Joined: 02 Feb 2014
Total Posts: 1041
28 Apr 2016 04:24 PM
Bumpp on this last question, please!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image