Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Define a variable to hold the pastebin code function (replace with your actual code)
- local pastebinCode = function()
- -- Paste your script code here that you would fetch from Pastebin
- print("Executing pastebin code!")
- -- Example of code from the pastebin
- -- You can remove this part and replace it with your own code
- end
- local movementEnabled = true -- Variable to track whether movement is enabled
- -- Get the UserInputService
- local UserInputService = game:GetService("UserInputService")
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- -- Define your hotkey here
- local hotkey = Enum.KeyCode.F -- Change this to your desired hotkey
- -- Function to toggle movement
- local function toggleMovement()
- local character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if humanoid then
- movementEnabled = not movementEnabled -- Toggle the movement state
- humanoid.PlatformStand = not movementEnabled -- Disables movement if set to true
- if movementEnabled then
- print("Movement enabled.")
- else
- print("Movement disabled.")
- end
- end
- end
- -- Run the pastebin code when the F key is pressed
- UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
- if not gameProcessedEvent and input.KeyCode == hotkey then
- -- Execute the pastebin code
- pastebinCode() -- Execute the code
- toggleMovement() -- Toggle movement
- print("Hotkey pressed! Loaded and ran pastebin code, toggled movement.")
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment