gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
roblox script gui speed and jump
- User
roblox script gui speed and jump
- Assistant
To change the speed and jump height of a player in a Roblox game using a Script and a GUI, you can follow these steps:
- Create a new LocalScript in the StarterPlayerScripts or StarterCharacterScripts service.
- Insert a ScreenGui object into the LocalScript.
- Insert a TextLabel and two TextBoxes into the ScreenGui. Name them "SpeedLabel", "SpeedTextBox", "JumpLabel", and "JumpTextBox" respectively.
- Position and customize the GUI elements as desired.
- Write the following code in the LocalScript:
-- Get the GUI elements local screenGui = script.Parent local speedTextBox = screenGui.SpeedTextBox local jumpTextBox = screenGui.JumpTextBox -- Get the player character local character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait() -- Function to update speed and jump height local function updateSpeedAndJump() -- Check if the TextBoxes have valid numeric values local speed = tonumber(speedTextBox.Text) local jumpHeight = tonumber(jumpTextBox.Text) if not speed or not jumpHeight then return end -- Set the speed and jump height of the character character.Humanoid.WalkSpeed = speed character.Humanoid.JumpPower = jumpHeight end -- Update the speed and jump height when the TextBox values change or when the GUI is displayed speedTextBox.FocusLost:Connect(updateSpeedAndJump) jumpTextBox.FocusLost:Connect(updateSpeedAndJump) updateSpeedAndJump() -- Initial update -- Display the GUI screenGui.Enabled = true
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.