PastDays
|
  |
| Joined: 09 Jan 2011 |
| Total Posts: 732 |
|
|
| 24 Aug 2016 04:11 PM |
Why isn't this working?
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local Shop = player.PlayerGui.Shop.Main
mouse.KeyDown:connect(function(key) if key == "m" then Shop.Visible = true end end)
-- PastDays |
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 24 Aug 2016 04:11 PM |
it's your script telling you to use UserInputService.InputBegan
Formerly ToxicDominator - add 17,509 posts |
|
|
| Report Abuse |
|
|
PastDays
|
  |
| Joined: 09 Jan 2011 |
| Total Posts: 732 |
|
|
| 24 Aug 2016 04:13 PM |
I don't know how to use that...
-- PastDays |
|
|
| Report Abuse |
|
|
Mitko0o1
|
  |
| Joined: 30 Nov 2010 |
| Total Posts: 5725 |
|
|
| 24 Aug 2016 04:13 PM |
KeyDown and KeyUp are deprecated from a long time, check these wiki posts for help:
http://wiki.roblox.com/?title=API:Class/UserInputService http://wiki.roblox.com/index.php?title=API:Class/UserInputService/InputBegan http://wiki.roblox.com/index.php?title=API:Class/UserInputService/InputEnded |
|
|
| Report Abuse |
|
|
PastDays
|
  |
| Joined: 09 Jan 2011 |
| Total Posts: 732 |
|
|
| 24 Aug 2016 04:15 PM |
I've been told they are depreciated and i dont have time to learn how to use this method i just need to quickly fix it...
-- PastDays |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 04:15 PM |
| or just do mouseclick or button one down |
|
|
| Report Abuse |
|
|
PastDays
|
  |
| Joined: 09 Jan 2011 |
| Total Posts: 732 |
|
|
| 24 Aug 2016 04:17 PM |
I dont need a mouse to trigger it... why are you telling me this... i clearly need the key "m" to trigger it.
-- PastDays |
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 24 Aug 2016 04:17 PM |
"or just do mouseclick or button one down" stop posting
Formerly ToxicDominator - add 17,509 posts |
|
|
| Report Abuse |
|
|
PastDays
|
  |
| Joined: 09 Jan 2011 |
| Total Posts: 732 |
|
|
| 24 Aug 2016 04:19 PM |
Is anyone able to help...?
-- PastDays |
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 24 Aug 2016 04:20 PM |
check the output
Formerly ToxicDominator - add 17,509 posts |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 04:20 PM |
| That script works fine for me, what's in your output? |
|
|
| Report Abuse |
|
|
Mitko0o1
|
  |
| Joined: 30 Nov 2010 |
| Total Posts: 5725 |
|
|
| 24 Aug 2016 04:20 PM |
Here is a flashlight script of mine:
https://www.roblox.com/Flashlight-script-item?id=262575710
Check the way I made it work for the button F, just change it for the button you want and delete the rest of the script that is for the flashlight. |
|
|
| Report Abuse |
|
|
| |
|
PastDays
|
  |
| Joined: 09 Jan 2011 |
| Total Posts: 732 |
|
|
| 24 Aug 2016 04:25 PM |
Their is no output.
-- PastDays |
|
|
| Report Abuse |
|
|
PastDays
|
  |
| Joined: 09 Jan 2011 |
| Total Posts: 732 |
|
| |
|
PastDays
|
  |
| Joined: 09 Jan 2011 |
| Total Posts: 732 |
|
| |
|
PastDays
|
  |
| Joined: 09 Jan 2011 |
| Total Posts: 732 |
|
|
| 24 Aug 2016 04:37 PM |
OK i made this yet it still isn't working...
local uis = game:GetService("UserInputService") local plr = game.Players.LocalPlayer local chatting = false local player = script.Parent.Parent local Shop = player.PlayerGui.Shop.Main
plr.Chatted:connect(function(msg) chatting = false end)
uis.InputBegan:connect(function(input) if input == Enum.KeyCode.Slash and game.StarterGui:GetCoreGuiEnabled("Chat") then chatting = true elseif input == Enum.KeyCode.Return then chatting = false end if chatting == false then if input == Enum.KeyCode.M then Shop.Visible = true print("Shop Is Visible") end end end)
-- PastDays |
|
|
| Report Abuse |
|
|
Mitko0o1
|
  |
| Joined: 30 Nov 2010 |
| Total Posts: 5725 |
|
|
| 24 Aug 2016 04:43 PM |
Well try doing this at the second if statement:
if input == Enum.KeyCode.M and not chatting then Shop.Visible = true print("Shop Is Visible") end
If that doesn't work try adding prints everywhere to see where exactly does the code stop working. |
|
|
| Report Abuse |
|
|
Mitko0o1
|
  |
| Joined: 30 Nov 2010 |
| Total Posts: 5725 |
|
|
| 24 Aug 2016 04:45 PM |
Oh wait, it should be input.KeyCode = Enum.KeyCode.Slash instead of input = Enum.KeyCode.Slash
And fix it everywhere you search for a button press. |
|
|
| Report Abuse |
|
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 24 Aug 2016 04:47 PM |
"Oh wait, it should be input.KeyCode = Enum.KeyCode.Slash instead of input = Enum.KeyCode.Slash" you can't write to the key that was pressed lol
Formerly ToxicDominator - add 17,509 posts |
|
|
| Report Abuse |
|
|
Mitko0o1
|
  |
| Joined: 30 Nov 2010 |
| Total Posts: 5725 |
|
|
| 24 Aug 2016 04:49 PM |
@Skel
UIS = game:GetService("UserInputService") UIS.InputBegan:connect(function(input, istyping) if input.KeyCode == Enum.KeyCode.F and istyping == false then if Enabled == false then Enabled = true
This is part of my flashlight script and it works perfectly. |
|
|
| Report Abuse |
|
|
PastDays
|
  |
| Joined: 09 Jan 2011 |
| Total Posts: 732 |
|
| |
|
Skellobit
|
  |
| Joined: 13 Apr 2016 |
| Total Posts: 12758 |
|
|
| 24 Aug 2016 04:50 PM |
instead of using the equal to operator you were trying to assign it a value
Formerly ToxicDominator - add 17,509 posts |
|
|
| Report Abuse |
|
|
Mitko0o1
|
  |
| Joined: 30 Nov 2010 |
| Total Posts: 5725 |
|
|
| 24 Aug 2016 04:51 PM |
Oh, well sometimes this happens.
Its 1am at me, gonna go to sleep soon |
|
|
| Report Abuse |
|
|
PastDays
|
  |
| Joined: 09 Jan 2011 |
| Total Posts: 732 |
|
|
| 24 Aug 2016 04:53 PM |
You could just fix it as all that you are doing is making me play musical words switching and replacing words then being told OOPS i mean do this...
Thank you for trying to help but i'm getting frustrated...
-- PastDays |
|
|
| Report Abuse |
|
|