This is pretty confusing so I'll explain the best I can.
What I Mean...
I want to know if it's possible to check if an action has been done in a Script (or Local Script), from another Script (Or Local Script). I want to see if an action has been done and if the action has been done, I want a piece of code to be executed.
For Example...
Let's say that if a player pressed a certain key on their keyboard such as 'L', then I want a code to be executed from another Script, say the print() function.
--Checks if player has pressed L
function onKeyPress(inputObject, gameProccessedEvent)
if inputObject.KeyCode == Enum.KeyCode.L then
game.Players.LocalPlayer.Character.Humanoid.Health = 0
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
--Prints if L has been pressed
print('L has been pressed')
--not sure what to do...
Now...
I know I could put the print() function into the onKeyPress code but I just chose this example to have you guys see what I am trying to do, is there any way to actually do this? Thanks for trying to answer or tried to answer this.
Greek

2 comments
Thanks for that, helped a little :)
<3