jdm281
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 177 |
|
|
| 06 Aug 2011 08:37 PM |
I consider my self to be an epic scripter so believe be I wouldn't be here if this one didn't have me completely stumped I'm working on a simple key press event in a tool:
Tool = script.Parent
function Equip(mouse) print("Equipped") wait(0.5) if mouse then print("Mouse Found") mouse.KeyDown:connect(KeyDown) else print("No Mouse") end print("Ready for key press") end
Tool.Equipped:connect(Equip)
function KeyDown(key) print("KeyDown") if key then print("Key") key = string.lower(key)
if key == "c" then ChangeStance(1)
elseif key == "x" then ChangeStance(2)
elseif key == "y" then ChangeStance(0)
end end end
works fine in Test mode but when I equip it on a sever this happens:
it prints "Equipped" it prints "Mouse Found" it prints "Ready for key press" but when I press a key it never prints "KeyDown" Thers no error or anything it just dosent work!
Any way I can fix this? Keep in mind it works fine in test mode. I'v never had a problem like this before any help would be grate.
|
|
|
| Report Abuse |
|
|
jdm281
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 177 |
|
| |
|
sdfgw
|
  |
 |
| Joined: 08 Jan 2009 |
| Total Posts: 41681 |
|
| |
|
jdm281
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 177 |
|
|
| 06 Aug 2011 08:44 PM |
| No I dident include the ChangeStance() function. |
|
|
| Report Abuse |
|
|
sdfgw
|
  |
 |
| Joined: 08 Jan 2009 |
| Total Posts: 41681 |
|
| |
|
jdm281
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 177 |
|
|
| 06 Aug 2011 08:46 PM |
| The last parts a secret that and thers no problem with that (the script dosent even get that far) |
|
|
| Report Abuse |
|
|
jdm281
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 177 |
|
| |
|
sdfgw
|
  |
 |
| Joined: 08 Jan 2009 |
| Total Posts: 41681 |
|
|
| 06 Aug 2011 08:50 PM |
| ah. Sorry then, I can't find the problem. Maybe somebody better with LocalScripts can. |
|
|
| Report Abuse |
|
|
jdm281
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 177 |
|
|
| 06 Aug 2011 08:52 PM |
| its weard its like it just ignores the key press connection. |
|
|
| Report Abuse |
|
|
|
| 06 Aug 2011 08:52 PM |
| You need to put it in a local script. there won't be any output then even if you use print. |
|
|
| Report Abuse |
|
|
jdm281
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 177 |
|
|
| 06 Aug 2011 08:56 PM |
| wow a local script I was just wondering how I missed that then I rumbaed the last time I slept. Trying it now. |
|
|
| Report Abuse |
|
|
jdm281
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 177 |
|
|
| 06 Aug 2011 08:59 PM |
Wow I spend months on stuff like this and THAT fixed it lol Im relly good at scripting but I dont know much about scripts vs local scripts |
|
|
| Report Abuse |
|
|
jdm281
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 177 |
|
|
| 06 Aug 2011 09:01 PM |
| Well anyway you just helped me finish a Crouch/Prone script for a black ops game im makeing |
|
|
| Report Abuse |
|
|