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 » Scripting Helpers
Home Search
 

Re: Trampoline won't work???

Previous Thread :: Next Thread 
Zerio920 is not online. Zerio920
Joined: 06 Apr 2012
Total Posts: 3311
06 Feb 2014 06:59 PM
I originally posted this in the Building Helpers forum, but it seems it might be more of something a script can fix.

So I have a brick set so the velocity is (0, 5000, 0) and it's supposed to shoot you up really high. It seems to work with regular bricks. However, with players, the brick will only bounce you up about 100-200 studs or so. There appears to be something to the Humanoid that doesn't allow players to bounce high. I tested it by putting the humanoid on a model. With the humanoid, it doesn't bounce as high as I'd like.

Is there some sort of script that can fix it? How should I fix it so you could get shot higher in the air?
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
06 Feb 2014 07:00 PM
Try editing P. The higher it is, the greater you bounce.
Report Abuse
YumERAGON is not online. YumERAGON
Joined: 18 Apr 2012
Total Posts: 3893
06 Feb 2014 07:01 PM
Try
x = script?Parent
for I=1,100 do
x.CFrame = x.CFrame +Vector3.new(0,10,0)
wait()
end
Report Abuse
YumERAGON is not online. YumERAGON
Joined: 18 Apr 2012
Total Posts: 3893
06 Feb 2014 07:02 PM
Dumb spell check

x = script.Parent

for i=1,20 do *
Report Abuse
YumERAGON is not online. YumERAGON
Joined: 18 Apr 2012
Total Posts: 3893
06 Feb 2014 07:11 PM
Oh it was a trampoline.... Never mind ignore this
Report Abuse
Zerio920 is not online. Zerio920
Joined: 06 Apr 2012
Total Posts: 3311
06 Feb 2014 08:18 PM
Well it isn't really a trampoline... just a brick thats supposed to bounce you to a really high platform. You aren't supposed to jump on it more than once.

@YumERGAON, what does that do?
Report Abuse
Zerio920 is not online. Zerio920
Joined: 06 Apr 2012
Total Posts: 3311
06 Feb 2014 08:19 PM
@maxomega, what's P?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
06 Feb 2014 08:24 PM
It's probably because characters are so fat, get their mass and multiply it by how high you want their body to go and gravity to cancel out the force of it.
Not tested, but whatever:

local enabled = true

local function getAllParts(object, list)
     for index, value in next, object:GetChildren() do
          if value:IsA("BasePart") then
               table.insert(list, value)
          end
          getAllParts(value, list)
     end
     return list
end

local function touched(hit)
     if not enabled or not hit or not hit.Parent then return end
     local character = ( hit.Parent:IsA("Model") and hit.Parent:FindFirstChild("Humanoid") ) and hit.Parent or false
     if character then
          enabled = false
          local totalMass = 0
          for index, value in next, getAllParts(character, {}) do
               totalMass = totalMass + value:GetMass()
          end
          totalMass = totalMass * 196.2
          
          character.Torso.Velocity = Vector3.new(0, totalMass * 5000, 0)
     end
     wait(0.1)
     enabled = true
end

script.Parent.Touched:connect(touched)
Report Abuse
Zerio920 is not online. Zerio920
Joined: 06 Apr 2012
Total Posts: 3311
08 Feb 2014 01:21 PM
I put that in the trampoline thingy, but it looked like it just teleported the person really high up in the air. It was hard to see what happened, but it didn't bring the effect I wanted.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
08 Feb 2014 01:36 PM
Change this: '* 5000'
Report Abuse
Zerio920 is not online. Zerio920
Joined: 06 Apr 2012
Total Posts: 3311
08 Feb 2014 01:54 PM
I lowered it to 500 but... still the same thing happens.
Report Abuse
Zerio920 is not online. Zerio920
Joined: 06 Apr 2012
Total Posts: 3311
08 Feb 2014 07:22 PM
bump
Report Abuse
KiwiMeister is not online. KiwiMeister
Joined: 18 Feb 2010
Total Posts: 1464
08 Feb 2014 07:35 PM
The wiki could help btw
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
08 Feb 2014 07:45 PM
Kiwi, you seem to post a lot, but never give any real advice :/

P is a property of BodyVelocity. P is short for power.

http://wiki.roblox.com/index.php?title=P_(Property)
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
08 Feb 2014 07:46 PM
Kiwi, you seem to post a lot, but never give any real advice. Just try to give advice if you know it. :/

P is a property of BodyVelocity. P is short for power.

http://wiki.roblox.com/index.php?title=P_(Property)
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
08 Feb 2014 07:47 PM
Whoops. Double post. My connection is horrible today .-.
Report Abuse
Zerio920 is not online. Zerio920
Joined: 06 Apr 2012
Total Posts: 3311
08 Feb 2014 08:41 PM
Where is P and how do I use it?
Report Abuse
Zerio920 is not online. Zerio920
Joined: 06 Apr 2012
Total Posts: 3311
08 Feb 2014 08:45 PM
nvm, found P, I'm dumb .-. Do I insert it into the trampoline?
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
09 Feb 2014 10:22 AM
Yes, you either insert the BodyVelocity with the given values, or define one within a script.
Report Abuse
Zerio920 is not online. Zerio920
Joined: 06 Apr 2012
Total Posts: 3311
10 Feb 2014 07:02 PM
@above - Maybe I'm doing this wrong, but adjusting P is still not adding any extra height to the bouncing.

I got it to work on people by putting this script in the brick:

function onTouched(part)
if part.Parent ~= nil then
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then

h.Parent.Torso.Velocity=Vector3.new(0,3500,0)
else
h.Parent.Velocity=Vector3.new(0,3500,0)
wait()

end
end
end

script.Parent.Touched:connect(onTouched)

The problem is that it only works on people, not bricks. I'd want this script to work on bricks too, so they also bounce as high.
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
10 Feb 2014 07:08 PM
You're not using BodyVelocity at all! It's a basic object. Also, your part:

if part.Parent ~= nil then
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then

these are all checks for players. Get rid of them, and it should work for anything.
Report Abuse
Zerio920 is not online. Zerio920
Joined: 06 Apr 2012
Total Posts: 3311
10 Feb 2014 07:13 PM
I know I'm not using bodyvelocity :P I said I tried that and it didn't work, so I resorted to a different script.
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
10 Feb 2014 07:14 PM
make the script insert a bodyThrust into the torso of the player, then after a few seconds remove the bodyThrust so the player falls back.
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
10 Feb 2014 07:14 PM
Well, I forgot about the Velocity property, so that could work. But if it doesn't I recommend going back to BodyV.
Report Abuse
Zerio920 is not online. Zerio920
Joined: 06 Apr 2012
Total Posts: 3311
10 Feb 2014 07:17 PM
Okay, so after removing that I get:

function onTouched(part)
h.Parent.Torso.Velocity=Vector3.new(0,3500,0)
else
h.Parent.Velocity=Vector3.new(0,3500,0)
wait()

end
end
end

script.Parent.Touched:connect(onTouched)

It's still not working, I feel like there's one small thing I need to add but I'm not sure what.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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