johnmaio.blogg.se

Roblox studio how to make super powers
Roblox studio how to make super powers







roblox studio how to make super powers

Heartbeat:Wait() - heartbeat:Wait() is faster and usually more reliable than wait() (you should avoid using wait() in your game's code) Humanoid.JumpPower += 1 - you might want to add a limit to this or players are going to be jumping very, very high (you might also be wondering what this += is, read a bit about what it is here While UserInputService:IsKeyDown(Enum.Ke圜ode.Space) do - check if space is being held down Local humanoid = and :FindFirstChildOfClass("Humanoid") - checks that the player actually has a character and humanoid so the script doesn't error If input.Ke圜ode = Enum.Ke圜ode.Space and not gameProcessedEvent then - checking for gameProcessedEvent will get rid of cases where space isn't being pressed to jump (e.g in chat) UserInputService.InputBegan:Connect(function(input, gameProcessedEvent) Local Heartbeat = game:GetService("RunService").Heartbeat Local UserInputService = game:GetService("UserInputService") Local humanoid = character:WaitForChild("Humanoid") - wait for the humanoid to be added Humanoid.Jump = false - stop the jump before it can happen Humanoid:GetPropert圜hangedSignal("Jump"):Connect(function() - listen for jumps Local humanoid = :WaitForChild("Humanoid") - wait for the humanoid to be added You can try this: - disable jumps for current character A BodyForce in the character will work fine for only reducing the character’s gravity. Setting Workspace.Gravity won’t work well because it will affect everything the player has control over, i.e. HumanoidRootPart.Velocity = Vector3.new(, releasejumppower, )Īnother option, seemingly used in earlier Mario games, is to have different gravity while the jump key is held and while it is not held. spacebar is released, cap the vertical velocity The first option is to cap off the vertical velocity when you let go of Space. There is no bug, it is doing exactly what you told it to do, and you told it to make the next jump higher while you’re holding space.Īs for actually making a controllable jump, I searched the internet (which is something you should do, too) and found a few ways to do it. But JumpHeight is only significant when you’re about to jump, not when you’re in the air, so this script essentially does nothing but make successive jumps higher as long as space is held.

roblox studio how to make super powers

Yeah, this code makes the jump height increase during the jump.









Roblox studio how to make super powers