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 would one disable W and S keys?

Previous Thread :: Next Thread 
nuke98 is not online. nuke98
Joined: 16 Jul 2008
Total Posts: 25506
26 Apr 2015 10:57 PM
I'd really like a script made for me but if not let me know if it's easy or not

R$13,220 Tx0
Report Abuse
TheNextEvolution is not online. TheNextEvolution
Joined: 08 Apr 2010
Total Posts: 1624
26 Apr 2015 10:58 PM
You would have to make a while w down Humanoid.WalkSpeed = 0 there's a hint xD
Report Abuse
Xucs is not online. Xucs
Joined: 23 Jul 2010
Total Posts: 11844
26 Apr 2015 11:00 PM
@thenext

That's not it at all.

You'd have to use the keydown function.
I'd search the wiki, it's one of the more useful entries.



Leveraged/tixmaker101 + 55k posts |
Report Abuse
nuke98 is not online. nuke98
Joined: 16 Jul 2008
Total Posts: 25506
26 Apr 2015 11:00 PM
Alright. What I'm trying to do is a 2D script while still allowing a conveyor to move the player between the background and foreground

R$13,220 Tx0
Report Abuse
TheNextEvolution is not online. TheNextEvolution
Joined: 08 Apr 2010
Total Posts: 1624
26 Apr 2015 11:02 PM
@Xucs I know that's what I meant lol I can make the script right now.
Report Abuse
nuke98 is not online. nuke98
Joined: 16 Jul 2008
Total Posts: 25506
26 Apr 2015 11:03 PM
@Next I know they don't like us doing this but I'll pay you depending on how hard it is

Doesn't sound terribly hard.

R$13,220 Tx0
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
26 Apr 2015 11:04 PM
I have a 2D Camera and Custom controls model somewhere in my inventory. Takett.
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
26 Apr 2015 11:06 PM
game:GetService("ControllerService"):ClearAllChildren()

Then creating custom controls so...

local Keys={}
local mouse=game.Players.LocalPlayer:GetMouse()
mouse.Button1Down:connect(function(key) Keys[key:lower()]=true end)
mouse.Button1Up:connect(function(key) Keys[key:lower()]=nil end)

game:GetService"RunService".RenderStepped:connect(function()
local position=Vector3.new(0,0,0)
if Keys["w"] then
position=position+Vector3.new(1,0,0)
end
if Keys["s"] then
position=position-Vector3.new(1,0,0)
end
if Keys["a"] then
position=position+Vector3.new(0,0,1)
end
if Keys["d"] then
position=position-Vector3.new(0,0,1)
end
game.Players.LocalPlayer.Character:WaitForChild("Humanoid"):MoveTo(position)
end)

--Might have mixed things up a bit, not tested e.e
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
26 Apr 2015 11:08 PM
Button1Up and Button1Down should be KeyDown and KeyUp, event beter InputBegan and InputEnded.
Report Abuse
nuke98 is not online. nuke98
Joined: 16 Jul 2008
Total Posts: 25506
26 Apr 2015 11:11 PM
Set the vectors on W and S to 0,0,0 and the Button1Down and up to KeyUp and KeyDown

Doesn't appear to do anything, can still use W and S

R$13,220 Tx0
Report Abuse
TheNextEvolution is not online. TheNextEvolution
Joined: 08 Apr 2010
Total Posts: 1624
26 Apr 2015 11:12 PM
Here for free!


local Enabled = true
local Player = game.Players.LocalPlayer
local Character = Player.Character
repeat wait() until Player.Character
local keysDown = {}
local keysUp = {}
local ws = Character.Humanoid.WalkSpeed

mouse = Player:GetMouse()
function onKeyDown(key)
keysDown[key]=true
keysUp[key]=nil
if key == "w" then
while keysDown[key]do wait()
Player.Character.Humanoid.WalkSpeed = 0

end
end
end

mouse.KeyUp:connect(function(key)
keysDown[key] = nil
keysUp[key]=true
if key == "w" then
while keysUp[key] do wait()
Player.Character.Humanoid.WalkSpeed = ws
end
end
end)
mouse.KeyDown:connect(onKeyDown)
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
26 Apr 2015 11:12 PM
TAKE MY MODEL @OP

It's called 2D Camera + Character Controls or something like that.
Report Abuse
nuke98 is not online. nuke98
Joined: 16 Jul 2008
Total Posts: 25506
26 Apr 2015 11:16 PM
http://www.roblox.com/2D-Camera-Adjusts-with-movement-item?id=196053296

@Goul I tried, didn't work.

@Next Still can use W and S, but all the scripts you guys are giving me looks like they should work.

R$13,220 Tx0
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
26 Apr 2015 11:17 PM
1 - That's the wrong model

2 - It does work you're just so incompetant you don't know how to set it up lol
Report Abuse
nuke98 is not online. nuke98
Joined: 16 Jul 2008
Total Posts: 25506
26 Apr 2015 11:18 PM
I know I'm incompetent that's why I'm coming here for help lol and it is near what you told me to look for so I figured that was it

R$13,220 Tx0
Report Abuse
TheNextEvolution is not online. TheNextEvolution
Joined: 08 Apr 2010
Total Posts: 1624
26 Apr 2015 11:18 PM
I tested my script it works is it in a local script in the playergui?
Report Abuse
nuke98 is not online. nuke98
Joined: 16 Jul 2008
Total Posts: 25506
26 Apr 2015 11:21 PM
That was my problem, wasn't putting it in the playergui. Noted and learned something today thank you, and your script was good but when you press W you still lunge forward a bit, Gouls works good. Sorry that was a pain, wasn't on purpose and I appreciate it you guys.

R$13,220 Tx0
Report Abuse
TheNextEvolution is not online. TheNextEvolution
Joined: 08 Apr 2010
Total Posts: 1624
26 Apr 2015 11:24 PM
Yeah that's the issue with mine and you're welcome.
Report Abuse
doctor152 is not online. doctor152
Joined: 30 Nov 2008
Total Posts: 308
27 Apr 2015 01:21 AM


What's with all the KeyDown listeners? Just use this:

for _, controller in pairs(game:GetService("ControllerService"):GetChildren()) do
controller.Parent = nil
end
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