|
| 05 Oct 2013 01:57 PM |
I am trying to get this simple script to work, but it just wont! What am I doing wrong here? -------------------------------------------------------------------------------------------------------- function onTouch(hit) local x = hit.Parent:FindFirstChild("Body Colors")
if (x.Name == "Contestant")then x.Name = "Body Colors"
else if (x.Name ~= "Contestant") then hit.Parent:FindFirstChild("Humanoid").Health = 0
end
end
end
script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
gansest
|
  |
| Joined: 08 Apr 2010 |
| Total Posts: 609 |
|
|
| 05 Oct 2013 02:00 PM |
No idea why you are using Contestant here: if (x.Name == "Contestant")then BUT... x is the Body Colors. use
if x ~= nil then instead of using x.Name checking. |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2013 02:02 PM |
| I think I get it... but your words are a bit jumbled. So what do I put instead of Name? |
|
|
| Report Abuse |
|
|
gansest
|
  |
| Joined: 08 Apr 2010 |
| Total Posts: 609 |
|
|
| 05 Oct 2013 02:04 PM |
| Your scripts makes the player DIE every times the player steps on. What's the idea? |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2013 02:05 PM |
| Ohhhhhhhhhhhhhhhhhhhhhhhhh... Darn, Just noticed my problem... lol I switched Body Colors with the name of contestant... |
|
|
| Report Abuse |
|
|
|
| 05 Oct 2013 02:06 PM |
| I'm good now, thanks though for the help :) |
|
|
| Report Abuse |
|
|
gansest
|
  |
| Joined: 08 Apr 2010 |
| Total Posts: 609 |
|
|
| 05 Oct 2013 02:06 PM |
| Alright. If you need something else-- PM me |
|
|
| Report Abuse |
|
|