Cjslick
|
  |
| Joined: 11 Jul 2009 |
| Total Posts: 2130 |
|
|
| 12 Aug 2013 07:57 PM |
Well, I'm trying to find the right way to write the following syntax:
if humanoid ~= nil and not script.Parent.team.Value == hit.Parent.Parent then
It's a condition within the Paintball gun that can sense Team Color from the Player, And then cancel out if the team colors are equal. The script said it was written fine but it doesn't look right IMO.
Also, You CAN'T TEST this in Studio.
|
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 07:59 PM |
Studio:
Tools:
Test:
Start Server
----After that
Studio:
Tools:
Test:
Start Player x2
There you go :P |
|
|
| Report Abuse |
|
|
Cjslick
|
  |
| Joined: 11 Jul 2009 |
| Total Posts: 2130 |
|
|
| 12 Aug 2013 08:00 PM |
| Ok, but can you say the syntax is correct? |
|
|
| Report Abuse |
|
|
|
| 12 Aug 2013 08:03 PM |
if humanoid ~= nil then if not script.Parent.team.Value == hit.Parent.Parent then
end
end
--You might want to check for those...but unless humanoid is predefined earlier it --won't work, also, how would hit.Parent.Parent be set to a team if you are --shooting at a player???/????
--I would recommend doing a better check than that...but other than the --questioning of your script, that should be correct. |
|
|
| Report Abuse |
|
|
Cjslick
|
  |
| Joined: 11 Jul 2009 |
| Total Posts: 2130 |
|
|
| 12 Aug 2013 08:11 PM |
Yeah, the paintball gun shoots at players spesifically. To make it work that way you have to do this syntax:
game.Players:playerFromCharacter()
Players include teams, if you use the explorer and open the properties of player.
Thanks for your help though, much appreciated. |
|
|
| Report Abuse |
|
|
Raphael7
|
  |
| Joined: 03 Dec 2008 |
| Total Posts: 2479 |
|
|
| 12 Aug 2013 08:12 PM |
I am not sure if there is a 'playerFromCharacter()'
I believe it is game.Players:GetPlayerFromCharacter(objectValue) |
|
|
| Report Abuse |
|
|
Cjslick
|
  |
| Joined: 11 Jul 2009 |
| Total Posts: 2130 |
|
|
| 12 Aug 2013 08:15 PM |
| I'll look into it. Perhaps same term in different phrasing? |
|
|
| Report Abuse |
|
|
Raphael7
|
  |
| Joined: 03 Dec 2008 |
| Total Posts: 2479 |
|
|
| 12 Aug 2013 08:17 PM |
| Different but if you use 'playFromCharacter()' your script will not function. |
|
|
| Report Abuse |
|
|