|
| 26 Apr 2014 07:36 PM |
Purpose: Injures specific teams that are displayed based on a value that's a child on that NPC.
Problem: Doesn't damage anyone.
Script:
function onTouched(hit) local human = hit.Parent:findFirstChild("Humanoid") if (human ~= nil) then local myteam = script.Parent.Parent.Parent:WaitForChild("TeamColor").Value local histeam = hit.Parent:FindFirstChild("TeamColor") if histeam and histeam:IsA("BrickColorValue") then if histeam.Value == myteam.Value then return else if 2 + 2 == 4 then human.Health = human.Health - 3 end end
end end end
script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
| |
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 26 Apr 2014 07:40 PM |
| You have a bunch of un-needed checking in your script.. and where is this parented, also your explanation of what it's supposed to do didn't match up to anything close to what you gave in the script. |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 07:46 PM |
| I don't think you understand scripting. |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 07:48 PM |
| If I try to help you, will you also insult me? |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 07:49 PM |
NPC +TeamColor +LinkedSword ++Handle +++DamageScript |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 07:49 PM |
| @xxx, No, he wasn't really helping though. Based on what he said he clearly had no understanding of scripting. |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 07:50 PM |
| And what I said wasn't really an insult :/ |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 07:56 PM |
1. You don't need a space between else and if, but it will achieve the same flow of execution.
2. I like the excessive checking, it makes the script more difficult to break.
3. Why are you using WaitForChild to fetch the TeamColor?
4. "I don't think you understand scripting." is an explosive insult to a scripter. |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 07:57 PM |
The problem is here:
local myteam = script.Parent.Parent.Parent:WaitForChild("TeamColor").Value ... if histeam.Value == myteam.Value then < |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 07:57 PM |
| But he's not a scripter lol. |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2014 08:00 PM |
| And darn, that part looked to me like it was correct. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 27 Apr 2014 08:26 PM |
Being the one that needs help, I think you're in a bit of a disposition to be insulting the people that do try. Luckily for you, I don't really care what you think about my skills as long as I know how good I am.
You should read this;
http://en.wikipedia.org/wiki/Respect |
|
|
| Report Abuse |
|
|
| |
|