alaneasy
|
  |
| Joined: 13 Aug 2012 |
| Total Posts: 55 |
|
|
| 08 Mar 2013 08:15 AM |
| Um,I want to make a script that when you touch a morph it gives you more health or walkspeed. Anyone willing to help? |
|
|
| Report Abuse |
|
|
koen500
|
  |
| Joined: 23 Feb 2011 |
| Total Posts: 2277 |
|
|
| 08 Mar 2013 08:20 AM |
First of all set up an function connected to an event.
script.Parent.Touched:connect(function(Hit)
end
Let it changed the health of the humanoid when touched. (make sure there is a humanoid!) |
|
|
| Report Abuse |
|
|
alaneasy
|
  |
| Joined: 13 Aug 2012 |
| Total Posts: 55 |
|
| |
|
koen500
|
  |
| Joined: 23 Feb 2011 |
| Total Posts: 2277 |
|
| |
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 08 Mar 2013 03:34 PM |
| 500, script.Parent.Touched:connect(function(Hit) --WHERE'S THE OTHER BRACKET? |
|
|
| Report Abuse |
|
|
|
| 08 Mar 2013 03:36 PM |
@smiley
It's an anonymous function, and there shouldn't be another parenthesis there. Where is should be is after the end;
script.Parent.Touched:connect(function(Hit) --Code end ) --Here
¤ ¤ † K M <( •д• )> X D † ¤ ¤
|
|
|
| Report Abuse |
|
|
|
| 08 Mar 2013 03:47 PM |
| Because he replied "What?" to very basic scripting, I don't think he'll understand anything we tell him. |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 08 Mar 2013 04:49 PM |
| Knight, that's what I thought it should be. :) |
|
|
| Report Abuse |
|
|
alaneasy
|
  |
| Joined: 13 Aug 2012 |
| Total Posts: 55 |
|
| |
|
koen500
|
  |
| Joined: 23 Feb 2011 |
| Total Posts: 2277 |
|
| |
|
koen523
|
  |
| Joined: 23 Feb 2011 |
| Total Posts: 4026 |
|
|
| 10 Mar 2013 05:53 PM |
| Just put a health changer script in the brick you touch. Just a second script. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2013 06:36 PM |
Im brand new to scripting and Im hopelessly lost trying to figure out haw it works. how can i create a simple script? i just want to make a brick with health, so i put a slate block in my place using studio, and called it slate stone 1 (yes i put spaces between slate and stone) then i typed into the command bar slate stone 1.health=100 how do i get this to work?! |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2013 06:58 PM |
ok i think i might be getting a little closer, i tried to create a script based on examples i have seen. tell me if this will work. if it will not work, please tell me why and how to fix it.
healthscripttest is the object i am trying to script with. it is a normal slate block that is 4x4x4studs
this is the "script"
healthscripttest.maxhealth=100.health=100 if.health=0(cancollide=true)
will that work or is it still way off? |
|
|
| Report Abuse |
|
|
koen500
|
  |
| Joined: 23 Feb 2011 |
| Total Posts: 2277 |
|
|
| 11 Mar 2013 02:06 AM |
| @523, Tha'ts using FMs. Go away. |
|
|
| Report Abuse |
|
|
basw333
|
  |
| Joined: 27 Oct 2012 |
| Total Posts: 11 |
|
|
| 11 Mar 2013 04:25 AM |
| LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL |
|
|
| Report Abuse |
|
|
|
| 11 Mar 2013 06:05 PM |
just found somthing wrong with my own script that my freind pointed out. i put cancollide as true. not what you want if you are trying to get the thing to fall through the ground. i also need to know how to add the script. can anyone help me with this? |
|
|
| Report Abuse |
|
|
koen523
|
  |
| Joined: 23 Feb 2011 |
| Total Posts: 4026 |
|
| |
|
| |
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 31 Mar 2013 03:45 AM |
This might go wrong but i give it a shot.
script.Parent.Touched:connect(function(Hit) hit.Parent.FindFirstChild("Humanoid") if Humanoid then hit.Parent.Humanoid.Maxhealth = 150 hit.Parent.Humanoid.Health = 50
end |
|
|
| Report Abuse |
|
|
Epic1230
|
  |
| Joined: 07 Dec 2011 |
| Total Posts: 289 |
|
|
| 31 Mar 2013 08:01 AM |
You didn't write any variables for Humanoid. Also, you wrote "Hit" with a capital, and you wrote the rest as "hit" with no capitals. Correct one:
script.Parent.Touched:connect(function(hit) humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid ~= nil then humanoid.MaxHealth = Number humanoid.Health = Number humanoid.WalkSpeed = Number end end)
I'm pretty sure that's correct, if it doesn't work, I'm sorry! |
|
|
| Report Abuse |
|
|
DjM4x
|
  |
| Joined: 26 Mar 2013 |
| Total Posts: 71 |
|
| |
|