Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How would i make this a keydown script? So that when i press a key it activates.

Asked by
exarlus 72
7 years ago
01wait(.1)
02--[[
03    A note from script:
04    If you decide to take this script, make sure you take the module as well. It's in workspace.
05    This won't work unless this script is a LocalScript in StarterGui/StarterPack and the modulescript is in workspace.
06    I hope you enjoy the script and the modulescript attached to it. In the video I have showed you how to add your
07    own effects and such. All you need is the chatted event and then the module functions
08    To add aura and hat use SSJAura() and SSJHat()
09    Thanks for using my script
10    --script_ing
11--]]
12local mod = require(workspace.SSJModule)
13local TransformationAnims = mod.TransformationAnims
14local ScreenAnims = mod.ScreenAnims
15local p = game.Players.LocalPlayer
View all 59 lines...

1 answer

Log in to vote
0
Answered by
Scaii_0 145
7 years ago

You would need to do this for a key pressed function

1function onKeyPress(inputObject, gameProcessedEvent) --Function
2    if inputObject.KeyCode == Enum.KeyCode.R then --What key you want to be pressed
3        print("R was pressed") --Put the rest of the script here (what you want to do)
4    end
5end
6 
7game:GetService("UserInputService").InputBegan:connect(onKeyPress) -- Make sure you have this at the end, else it wont work

Of course for more in-depth explanations you could check out the roblox wiki. There are even the scripting books on the page.

Ad

Answer this question