How to make a Trampoline: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Mindraker
(Now we have a script in there...)
>Mindraker
mNo edit summary
Line 1: Line 1:
{{CatUp|Tutorials}}
__TOC__
==Introduction==
==Introduction==
This is a tutorial for '''BEGINNER TO INTERMEDIATE BUILDERS''', so anyone should be able to do this tutorial just fine. This tutorial is also easiest in '''ROBLOX STUDIO''', but if you prefer solo, that's fine.
This tutorial is intended to show how to build a trampoline.


==Setup==
==Setup==
Let's begin by adding one bricks. Now, you'll want to look in your properties, and if you don't have the properties window, then select View->Properties.
Let's begin by adding one brick. Now, you'll want to look in your properties, and if you don't have the properties window, then select View->Properties.


==Making it a Trampoline==
==Script==
* Select the brick.  
* Select the brick.  
* Insert > Object > Script.
* Insert > Object > Script.
Line 26: Line 29:
This script was taken right from the trampoline model.
This script was taken right from the trampoline model.
The problem with this is that if you make your entire trampoline with this script, the trampoline will bounce equally high in the middle as on the outer edge.  This isn't representative of real life.  So, what you can do is make the trampoline bricks in the middle bounce a little higher (the 'sweet spot') than on the outer edges to make it a little more realistic.
The problem with this is that if you make your entire trampoline with this script, the trampoline will bounce equally high in the middle as on the outer edge.  This isn't representative of real life.  So, what you can do is make the trampoline bricks in the middle bounce a little higher (the 'sweet spot') than on the outer edges to make it a little more realistic.
[[Category:Scripting Tutorials]]

Revision as of 11:18, 26 September 2008

Introduction

This tutorial is intended to show how to build a trampoline.

Setup

Let's begin by adding one brick. Now, you'll want to look in your properties, and if you don't have the properties window, then select View->Properties.

Script

  • Select the brick.
  • Insert > Object > Script.
  • Copy and Paste the following into the script object:
function onTouched(part) -- when the brick gets touched
	if part.Parent ~= nil then -- if it's human
		local h = part.Parent:findFirstChild("Humanoid") 
			if h~=nil then 
				
h.Parent.Torso.Velocity=Vector3.new(0,200,0) -- shoot your humanoid in the air to y=200
wait(0.5) -- wait this long						
			end
	end
end
script.Parent.Touched:connect(onTouched)

This script was taken right from the trampoline model. The problem with this is that if you make your entire trampoline with this script, the trampoline will bounce equally high in the middle as on the outer edge. This isn't representative of real life. So, what you can do is make the trampoline bricks in the middle bounce a little higher (the 'sweet spot') than on the outer edges to make it a little more realistic.