Hi everyone. I’m trying to make my ski tool so when you tap on a key on your keyboard it ‘freezes’ the user who’s using the tool. By that, I mean stopping the movement of the user. I’ve found this line regulates this, and when I section it out as a comment (by doing --), it does what I would like it to do. However, I’m having trouble actually making the code not read it (skip past it) depending on if a key has been pressed, let’s say for this example, f on the keyboard. I’ve tried using a if statement and tried elif and else, however the tool just breaks when I do that. The only thing that works is two dashes to comment it out.
So I was wondering if there was a way to update the code so it adds and removes the two dashes (which section that line for commenting) when the f key has been pressed. I’m 70% sure that this isn’t possible, so could anyone tell me on what to do? The line + the code is shown below:
Are you sure the if statment breaks it? Didn’t you try to just
if UserInputService:IsKeyDown(Enum.KeyCode.<the key you want>) then
And also from what I know there is no way of editing a script not manually, something you can do is have a seperate that’s enabled or would only run if it recieves a signal (embedded events/ fuctions) but that’s kind of really unneficient and hacky.
Cheers, forgot to do that. It still breaks even with your code inserted. Forgot to switch my character to R6 The tool isn’t compatible with R15 which is what I was using), thank you so much!!!
Perhaps the if statment only checked once, because if statments don’t keep on checking, meaning they only check when when the game starts.
For example, we have an if statment that checks if a value is equal to true, as soon as the game starts that value is false, but after 5 minutes it’s changed to true, but the if statment wouldn’t pass when it changed to true, because it already checked at the game’s start and it wasn’t false so it went on.