|
| 03 Nov 2012 04:38 PM |
| I'm making a disaster game and I want to put a script in any disaster so when the disaster touches a tower it tilts it or knocks it over. Before you call me an idiot, I have no idea where to start with the script so if you could at least start it I would appreciate it. |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Nov 2012 04:47 PM |
--This has to be put a brick. Such as a disasters arm, torso, head, etc.
function Touch(hit) hit:BreakJoints() end
script.Parent.Touched:connect(Touch) |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 04:47 PM |
| I don't want the person to die, I want a tower to be able to be knocked over once the disaster hits hard enough. |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 04:52 PM |
There is no function to do that. There are some methods to use to make your own cutom function to do this. I'll try, here:
name = "TowerName" --Put tower name here.
function onTouch(hit) if hirt.Parent.Name == name then hit.CFrame = hit.CFrame + Vector3.new(10,0,0) end end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 04:52 PM |
| if hit.Parent.Name == name then* |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 04:54 PM |
| But I want the disaster to be able to hit any tower and knock it over. |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 04:58 PM |
names = {"TowerName1","TowerName2","TowerName3}" --Put tower name here.
function onTouch(hit) for i = 1, #names do if hit.Parent.Name == names[i] then hit.CFrame = hit.CFrame + Vector3.new(10,0,0) end end end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 05:00 PM |
| Legend seems to be picky... |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 05:01 PM |
| What would I put the script in to make it work? |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 05:03 PM |
| If I needed this to go into a zombie, then would I put it in its arms, torso, head, and legs? |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 05:07 PM |
| What about a script that if a disaster touches it, it just makes it tilt a little, but if enough force is applied to it, then it falls? |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 05:08 PM |
| if its something like a tornado, you could put it in the block that houses the mesh, that way when the tornado hits the building, it looks like its literrally tearing it apart! |
|
|
| Report Abuse |
|
|
| |
|
thumper10
|
  |
| Joined: 17 Apr 2009 |
| Total Posts: 3304 |
|
|
| 03 Nov 2012 05:09 PM |
YOU ARE ASKING WAY TOO MANY QUESTIONS FOR ONE TOPIC! Chill out! Let's start with knocking the Tower over, I believe there is a Rotate Model API Created by Anaminus (or someone else). Give me a moment to search for it.
- thumper10, C# Lover |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 05:09 PM |
@LUV
The very first script you posted I tried. It doesn't work. |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 05:10 PM |
step 1: study physics of roblox step 2: depend on it. |
|
|
| Report Abuse |
|
|
thumper10
|
  |
| Joined: 17 Apr 2009 |
| Total Posts: 3304 |
|
|
| 03 Nov 2012 05:12 PM |
I can't seem to find because I'm too lazy. However there is an API that allows for easy rotation of a model. I wouldn't recommend it though, rotating a large tower with many parts can cause a physics engine overload. Imagine updating the position of everything touching it to match it's tilt. *shiver*
- thumper10, C# Lover |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 05:13 PM |
dats y u depemd on da phryciz of roblox!!
n CFrame doesnt go with thye phycis of roblx |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2012 05:15 PM |
| Does the last script that LUV told me work? How do I test it? |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Nov 2012 05:18 PM |
| How do I test it? It didn't work for me. |
|
|
| Report Abuse |
|
|
thumper10
|
  |
| Joined: 17 Apr 2009 |
| Total Posts: 3304 |
|
|
| 03 Nov 2012 05:19 PM |
No need to test. I can tell you it won't give you the desired result. Go look in Free Models for "Model Rotation", and find a good one to use. Learn how to use it an enjoy.
- thumper10, C# Lover |
|
|
| Report Abuse |
|
|
| |
|