generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: ROBLOX bunnyhopping prevention

Previous Thread :: Next Thread 
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
25 Feb 2015 08:47 AM
Hey, I'm trying to prevent bunnyhoppers on my game as the :Touched event seems to not be firing randomly due to the bad ROBLOX physics :P

When I have this:

game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function()
game.Players.LocalPlayer.Character.Humanoid.Jump = false
end)

I can't jump at all. I thought 'Well, great! So all I need to do is add a cooldown now and there will be no bunnyhoppers!'

I was wrong.

local cooldown = false

game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function()
if cooldown == false then
game.Players.LocalPlayer.Character.Humanoid.Jump = false
cooldown = true
wait(1)
cooldown = false
end
end)

It turns out that if you have anything before disabling the jump, the jump won't disable;/

Does anyone have any ideas on how I could prevent bunnyhopping?
Report Abuse
davisky2 is not online. davisky2
Joined: 04 Mar 2012
Total Posts: 4710
25 Feb 2015 08:51 AM
You could make a "CanCollide = false" part which has the kill script inside of it and on top of the killing part.
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
25 Feb 2015 08:51 AM
"Bunny hopping"

Idk what you are trying to do but you could


blah blah blah.changed
game.Players.LocalPLayer.Character.Humanoid.Jump = false
end


--local

keydown = 'spacebar' do
if cooldown = false then
game.Players.LocalPlayer.Character.Humanoid.Jump = true
coldown = true
end

blah blah blah
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
25 Feb 2015 08:55 AM
DaviSky, I don't understand how that has anything to do with preventing bunnyhopping and Crow jump = true won't work if the .Changed is making it false every time :P
Report Abuse
davisky2 is not online. davisky2
Joined: 04 Mar 2012
Total Posts: 4710
25 Feb 2015 08:56 AM
Oh i thought youre talking if a player touches a brick while jumping repeadetly he doesnt die.
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
25 Feb 2015 09:04 AM
Play my game and you'll find out :P

Also, crow that actually might work to some extent because I could create 2 localscripts with one containing:

game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function()
game.Players.LocalPlayer.Character.Humanoid.Jump = false
end)

and something like

keydown = 'spacebar' do
game.Players.LocalPlayer.PlayerGui.jumplimit2.Disabled = true
game.Players.LocalPlayer.Character.Humanoid.Jump = true
game.Players.LocalPlayer.PlayerGui.jumplimit2.Disabled = false
wait(0.9)
end

That might not work if the player spams spacebar though ;/
I think the default jump takes around 0.75 seconds long but not too sure, found it out somewhere.
Report Abuse
CrowClaws is not online. CrowClaws
Joined: 04 Jul 2010
Total Posts: 4466
25 Feb 2015 09:09 AM
I think there is a jump finished event.
I've seen it done...
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
25 Feb 2015 09:22 AM
nope

http://wiki.roblox.com/index.php?title=Category:Events

only event I found about jumping is JumpRequest

http://wiki.roblox.com/index.php?title=JumpRequest_(Event)
Report Abuse
Argelius is not online. Argelius
Joined: 19 Jul 2010
Total Posts: 4047
25 Feb 2015 09:55 AM
bunnyhopping is strategy
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
25 Feb 2015 09:57 AM
Dayum if I could actually bunnyhop in Roblox i'd be moving really fast through the map


CentOS-Web = /var/www/html/
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
25 Feb 2015 09:58 AM
No, it ruins my game(TNT RUN SPACE) as the majority of times, the parts won't fall because you didn't touch the part for long enough;/
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
25 Feb 2015 10:12 AM
FIXED!

This is rather inefficient, if you know a more efficient method of doing this then feel free to share it<3

First script(not disabled):

repeat wait(0.1) until game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
game.Players.LocalPlayer.PlayerGui.jumplimit.Disabled = false

Second script(Disabled):
game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function()
game.Players.LocalPlayer.Character.Humanoid.Jump = false
game.Players.LocalPlayer.PlayerGui.jumplimit3.Disabled = false
end)

Third script(Disabled):
game:GetService("UserInputService").JumpRequest:connect(function()
game.Players.LocalPlayer.PlayerGui.jumplimit2.Disabled = true
game.Players.LocalPlayer.PlayerGui.jumplimit3.Disabled = false
end)

Fourth script(Disabled):

game.Players.LocalPlayer.PlayerGui.jumplimit.Disabled = true
game.Players.LocalPlayer.PlayerGui.jumplimit2.Disabled = true
game.Players.LocalPlayer.Character.Humanoid.Jump = true
wait(0.4)
game.Players.LocalPlayer.PlayerGui.jumplimit.Disabled = false
wait(0.5)
game.Players.LocalPlayer.PlayerGui.jumplimit3.Disabled = true
game.Players.LocalPlayer.PlayerGui.jumplimit2.Disabled = false

--Code by kingstarwest<3
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
25 Feb 2015 10:22 AM
I thought getting whenever they jumped and then making Jumping to false stops it...

Or you could have a bodyforce to force them downward


CentOS-Web = /var/www/html/
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
25 Feb 2015 10:24 AM
Yeah but that'll prevent players from jumping all together, I just want to prevent players from bunnyhopping.

Bodyforce is probably not the best to use because it'll probably spaz your character out lol
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
25 Feb 2015 10:27 AM
I had this script in my gun that detected whenever they had space held. I had a while loop for a custom jump animation whenever they were jumping


CentOS-Web = /var/www/html/
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
22 May 2015 11:54 AM
UPDATE: I've made this work but there seems to be a problem with it as the player is forced to jump on an IPAD, Can anyone help me out?

jumplimitload:
repeat wait(0.1) until game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
game.Players.LocalPlayer.PlayerGui.jumplimit.Disabled = false

jumplimit:
game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function()
game.Players.LocalPlayer.Character.Humanoid.Jump = false
game.Players.LocalPlayer.PlayerGui.jumplimit3.Disabled = false
end)

jumplimit2:
game:GetService("UserInputService").JumpRequest:connect(function()
game.Players.LocalPlayer.PlayerGui.jumplimit2.Disabled = true
game.Players.LocalPlayer.PlayerGui.jumplimit3.Disabled = false
end)

jumplimit3:
game.Players.LocalPlayer.PlayerGui.jumplimit.Disabled = true
game.Players.LocalPlayer.PlayerGui.jumplimit2.Disabled = true
game.Players.LocalPlayer.Character.Humanoid.Jump = true
wait(0.4)
game.Players.LocalPlayer.PlayerGui.jumplimit.Disabled = false
wait(0.5)
game.Players.LocalPlayer.PlayerGui.jumplimit3.Disabled = true
game.Players.LocalPlayer.PlayerGui.jumplimit2.Disabled = false

It's very inefficient and was wrote a long time ago, anyone know any updated methods?

Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
22 May 2015 12:12 PM
bump

made a cool bounce

---
local cooldown = false

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
character.Humanoid.Changed:connect(function()
if cooldown == false then
character.Humanoid.Jump = false
wait(0.1)
cooldown = true
character.Humanoid.Jump = true
wait(0.5)
cooldown = false
end
end)
end)
end)
---
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
22 May 2015 12:13 PM
local humanoid = script.Parent:WaitForChild("Humanoid")
local cooldown = 1
local coolling = false
local last = nil

humanoid.Changed:connect(function()
if last then
if tick() - last >= cooldown then
coolling = false
end
end
if not coolling then
coolling = true
last = tick()
else
humanoid.Jump = false
end
end)


I script -~ chimmihc
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
22 May 2015 12:17 PM
Did you try this:


local cooldown = true

game.Players.LocalPlayer.Character.Humanoid.Changed:connect(function()
game.Players.LocalPlayer.Character.Humanoid.Jump = false
if cooldown then
cooldown = false
game.Players.LocalPlayer.Torso.Velocity = Vector3.new(0, 5, 0) --Change 5 to a larger or smaller number until it works just like a regular jump :P
wait(1)
cooldown = true
end
end)
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
22 May 2015 12:21 PM
Thanks chimmihc! :D

Thanks warspyking but I want to avoid using bodyforces, velocity etc ;D
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
22 May 2015 12:31 PM
---
local humanoid = script.Parent:WaitForChild("Humanoid")
local cooldown = 1
local coolling = false
local last = nil

humanoid.Changed:connect(function()
if last then
if tick() - last >= cooldown then
coolling = false
end
end
if not coolling then
coolling = true
last = tick()
else
humanoid.Jump = false
end
end)
---

Works amazingly in test solo but doesn't work on a server? D:
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
22 May 2015 12:32 PM
Why would you avoid it? It's the clean way to do this :P
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
22 May 2015 12:41 PM
How much do I have to bet that you used a server script?

Use a local script.


I script -~ chimmihc
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
22 May 2015 12:45 PM
Ah, should of guessed xD

Thanks! ;D
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
22 May 2015 12:52 PM
Works online for PC users but now IPAD users can't jump at all xD
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image