Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Letter pressed error?

Basically, this is quite a simple script, when "w" is pressed, I want the script to enable and when "s" is pressed I want the script to disable. It seems to disable fine then doesn't enable itself again when "w" is pressed.

Here's the script:

Mouse.KeyDown:connect(function(key)
if key:lower() == "s"  then
script.Disabled = true
end
end)

Mouse.KeyDown:connect(function(key)
if key:lower() == "w"  then
script.Disabled = false
end
end)

Any help to resolving this is appreciated.

1 comment

0

Is this a joke? Because I find this super entertaining. Once a script is disabled, none of the code within the script will run. And why do you need to do this anyway? I don't see the point.

1 answer

Well don't use KeyDown it's deprecated by Roblox I advise you to use ContextActionService or UserInputService. Learn how to use them then try it with those it should work if you did it correctly with those services I just stated.

4 comments

0

Maybe this isn't as obvious as I thought.

0

I know that but, I just wanted to tell him to use ContextActionService and UserInputService

0

I thought that script could be a variable he put for another script... Since he didn't share the whole script

0

Sure, but that has NOTHING to do with his script not working

This discussion is preserved as it was. New answers, comments, and votes are closed.