|
| 19 Aug 2016 09:25 AM |
Idk. I'll add notes next to each of them describing what they do
Script isn't Local
local tool = script.Parent
function onKeyDown(key) if (key ~= nil) then key = key:lower() if (key == "q") then tool.Handle.keybladedraw:Play() -- Plays the Keybladedraw sound tool.Handle.pe1.Enabled = true --Plays ParticleEmitter1 tool.Handle.pe2.Enabled = true -- Plays ParticleEmitter2 tool.Handle.pe3.Enabled = true -- Plays ParticleEmitter3 tool.Handle.pe4.Enabled = true -- Plays ParticleEmitter4 tool.Handle.Transparency = 0 -- Self explanatory wait(0.5) tool.Handle.keybladedraw:Pause() -- Pauses the Keybladedraw sound tool.Handle.pe1.Enabled = false -- Turns off ParticleEmitter1 tool.Handle.pe2.Enabled = false -- Turns off ParticleEmitter2 tool.Handle.pe3.Enabled = false -- Turns off ParticleEmitter3 tool.Handle.pe4.Enabled = false -- Turns off ParticleEmitter4 tool.Handle.Transparency = 1 -- Self explanatory tool.Handle.decal1.Transparency = 0 -- Puts decal1 on the now transparent handle tool.Handle.decal1.Transparency = 0 -- Puts decal2 on the now transparent handle tool.Handle.Drawn.Value = true -- Makes a BoolValue true stating the blade is drawn print("Keyblade Drawn")
-- Pretty much the other half of this script is the exact same it's just reverse --
elseif (key == "e") then tool.Handle.keybladedraw:Play() tool.Handle.decal1.Transparency = 1 tool.Handle.decal2.Transparency = 1 tool.Handle.pe1.Enabled = true tool.Handle.pe2.Enabled = true tool.Handle.pe3.Enabled = true tool.Handle.pe4.Enabled = true tool.Handle.Transparency = 0 wait(0.5) tool.Handle.keybladedraw:Pause() tool.Handle.pe1.Enabled = false tool.Handle.pe2.Enabled = false tool.Handle.pe3.Enabled = false tool.Handle.pe4.Enabled = false tool.Handle.Transparency = 1 tool.Handle.Drawn.Value = false
end end end
tool.Equipped:connect(function(mouse) mouse.KeyDown:connect(onKeyDown) end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Aug 2016 09:55 AM |
| Like I said in your other thread use uis keydown is deprecated |
|
|
| Report Abuse |
|
|
MajorBoi
|
  |
| Joined: 21 Jun 2012 |
| Total Posts: 284 |
|
| |
|
|
| 19 Aug 2016 10:03 AM |
| exactly u haven't identified user input service u noob |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2016 10:07 AM |
Since I actually am a noob I'm not salty xD
I thought KeyDown was much easier to understand but I guess I'll use the other method |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2016 10:08 AM |
| It's fine just wanted to give you a reminder. |
|
|
| Report Abuse |
|
|
llaserx
|
  |
| Joined: 10 Dec 2011 |
| Total Posts: 53069 |
|
|
| 19 Aug 2016 10:08 AM |
| Serverscripts cant get players mouse |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2016 10:11 AM |
http://wiki.roblox.com/?title=API:Class/UserInputService
Which of the functions or events should I be looking at for what I'm trying to do..? |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2016 10:25 AM |
Input began
Input ended and there's another wiki page on it go find it
I can't am on mobile 2 hard |
|
|
| Report Abuse |
|
|