Jiquor
|
  |
| Joined: 02 Jun 2008 |
| Total Posts: 10249 |
|
|
| 04 Jun 2016 09:57 PM |
local UIS = game:GetService("UserInputService") UIS.InputBegan:connect(function(Key,GPE) if Key.KeyCode == Enum.KeyCode.W and not GPE then local Player = hit.Parent:findFirstChild("Humanoid") local Player = game.Players.LocalPlayer.WalkSpeed = 100 end end)
I'm looking to disable WASD Keys and leave Arrows keys and Space Bar in my game. Yeah, what did I do wrong here? Speed still goes at 16 and not 0 The error I mainly see that I cannot figure out is: Expected Identifier, got '='
What did I do wrong? |
|
|
| Report Abuse |
|
|
lululukas
|
  |
| Joined: 23 Aug 2010 |
| Total Posts: 1043 |
|
|
| 04 Jun 2016 10:00 PM |
local Player = game.Players.LocalPlayer.WalkSpeed = 100
Really? You can't set the variable and the value at the same time. |
|
|
| Report Abuse |
|
|
iiSquare
|
  |
| Joined: 01 Apr 2012 |
| Total Posts: 390 |
|
|
| 04 Jun 2016 10:01 PM |
local UIS = game:GetService("UserInputService") UIS.InputBegan:connect(function(Key,GPE) if Key.KeyCode == Enum.KeyCode.W and not GPE then local Player = hit.Parent:findFirstChild("Humanoid") local Player = game.Players.LocalPlayer.WalkSpeed == 100 end end)
|
|
|
| Report Abuse |
|
|
|
| 04 Jun 2016 10:01 PM |
Also, it's
Player = game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 100
|
|
|
| Report Abuse |
|
|
lululukas
|
  |
| Joined: 23 Aug 2010 |
| Total Posts: 1043 |
|
|
| 04 Jun 2016 10:01 PM |
| iiSquare is wrong as well. |
|
|
| Report Abuse |
|
|
|
| 04 Jun 2016 10:02 PM |
Nvm at my last post I was too stupid to check my whole line of code local player = game.Players.LocalPlayer Player.Character.Humanoid.WalkSpeed = 100
|
|
|
| Report Abuse |
|
|
lululukas
|
  |
| Joined: 23 Aug 2010 |
| Total Posts: 1043 |
|
| |
|
|
| 04 Jun 2016 10:03 PM |
There
local Player = game.Players.LocalPlayer Player.Character.Humanoid.WalkSpeed = 100
|
|
|
| Report Abuse |
|
|
|
| 04 Jun 2016 10:04 PM |
| lol u forgot to capitalize P |
|
|
| Report Abuse |
|
|
Jiquor
|
  |
| Joined: 02 Jun 2008 |
| Total Posts: 10249 |
|
|
| 04 Jun 2016 10:14 PM |
| I'm learning how to bind keys and do this, thanks for helping guys, I really appreciate this so much |
|
|
| Report Abuse |
|
|
johny220
|
  |
| Joined: 30 Oct 2011 |
| Total Posts: 4584 |
|
| |
|
Jiquor
|
  |
| Joined: 02 Jun 2008 |
| Total Posts: 10249 |
|
|
| 04 Jun 2016 10:39 PM |
WEIRD
local UIS = game:GetService("UserInputService") UIS.InputBegan:connect(function(Key,GPE) if Key.KeyCode == Enum.KeyCode.W and not GPE then local Player = game.Players.LocalPlayer Player.Character.Humanoid.WalkSpeed = 0 end end)
it disabled ALL OF THE KEYS that move the character and I want to set walkspeed to zero I only want to disable WASD NOT the arrow keys |
|
|
| Report Abuse |
|
|
lululukas
|
  |
| Joined: 23 Aug 2010 |
| Total Posts: 1043 |
|
|
| 04 Jun 2016 10:43 PM |
| Because you don't reset the walkspeed back to 16 when an arrow key is pressed i assume. |
|
|
| Report Abuse |
|
|
Jiquor
|
  |
| Joined: 02 Jun 2008 |
| Total Posts: 10249 |
|
| |
|
lululukas
|
  |
| Joined: 23 Aug 2010 |
| Total Posts: 1043 |
|
|
| 04 Jun 2016 10:47 PM |
| Do the same thing except for all arrow keys, except set the walkspeed back. |
|
|
| Report Abuse |
|
|
Jiquor
|
  |
| Joined: 02 Jun 2008 |
| Total Posts: 10249 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 05 Jun 2016 12:42 AM |
local uis = game:GetService("UserInputService") local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:wait() local human = char.humanoid
uis.InputBegan:connect(function(input,event) if event then return end if input.KeyCode == Enum.KeyCode.W then human.WalkSpeed = 100 end end)
|
|
|
| Report Abuse |
|
|
|
| 05 Jun 2016 12:44 AM |
johny220 what does L.U.A stand for?
|
|
|
| Report Abuse |
|
|
johny220
|
  |
| Joined: 30 Oct 2011 |
| Total Posts: 4584 |
|
|
| 05 Jun 2016 09:52 AM |
idk that is the coder language roblox uses.
|
|
|
| Report Abuse |
|
|
lululukas
|
  |
| Joined: 23 Aug 2010 |
| Total Posts: 1043 |
|
| |
|
Jiquor
|
  |
| Joined: 02 Jun 2008 |
| Total Posts: 10249 |
|
|
| 05 Jun 2016 10:48 AM |
"your L.U.A is wrong" > doesn't know what L.U.A means
learn before you try and roast people |
|
|
| Report Abuse |
|
|
johny220
|
  |
| Joined: 30 Oct 2011 |
| Total Posts: 4584 |
|
| |
|
|
| 05 Jun 2016 11:15 AM |
all of you are so bad at L.U.A. like seriously
|
|
|
| Report Abuse |
|
|
Jiquor
|
  |
| Joined: 02 Jun 2008 |
| Total Posts: 10249 |
|
|
| 05 Jun 2016 03:04 PM |
you're stupid narwhal hat is worse :b
but i solved it, I rewrote the script with someone |
|
|
| Report Abuse |
|
|
Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37142 |
|
| |
|