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

Whats the script for `Push a key to run a script`? [closed]

Asked by 5 years ago

I`ve been trying to figure out how to run a certain script by pressing a key. Also if you could add how to make it so the owner of the game can only run it then thanks.

Closed as Not Constructive by Griffi0n, climethestair, and minikitkat

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
1
Answered by 5 years ago

Use UserInputService for the key part, found here: https://wiki.roblox.com/index.php?title=API:Class/UserInputService/InputBegan

Then use If statements (conditional statements) to detect the players name and or UserId: http://robloxdev.com/articles/Conditional-Statements-in-Lua

Then you'd want to change the WalkSpeed of the Humanoid, properties of the humanoid: http://wiki.roblox.com/index.php?title=API:Class/Humanoid

Ad