|
| 19 Aug 2011 03:49 PM |
how do you make a script that effects all the players in the game?
I'm making a script that does damage to "humanoids" (lower case "h") but doesn't do damage to "Humanoids" (upper case "H").
also, how do you make a script that only effects members of a certain team? |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 19 Aug 2011 03:56 PM |
| i didnt mean team as in group, i meant team (like red team) |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Aug 2011 03:59 PM |
so would this work?
v = player v.Character = Player.Character
while true do wait(0.01) for _,v in pairs (game:GetService("Players"):GetPlayers()) do if FindFirstChild("humanoid") then humanoid.Health < 100 else nil end |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 19 Aug 2011 04:01 PM |
| this isnt a request, its a scripting question. im not asking for anyone to write the script for me. |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 19 Aug 2011 04:03 PM |
like this? sorry if this is a stupid question, im pretty new to scripting, and im attempting to script my first game.
while true do wait(0.01) for _,v in pairs (game:GetService("Players"):GetPlayers()) do v = player v.Character = Player.Character if FindFirstChild("humanoid") then humanoid.Health < 100 else nil end |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2011 04:05 PM |
the thing is, i want the health to drain until it reaches 0, so would i use Health < 100? |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2011 04:06 PM |
for i = 100,0,-1 do humanoid.Health = i
^^put that in your script
~~ In Soviet Russia, scripts write you. ~~ |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 19 Aug 2011 04:09 PM |
@myrc
he wants it to drain. :/
~~ In Soviet Russia, scripts write you. ~~ |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2011 04:10 PM |
TakeDamage drains? I don't think so... but then again I hardly ever use it.
~~ In Soviet Russia, scripts write you. ~~ |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2011 04:11 PM |
ok, so is THIS right?
i = 100,0,-1
while true do wait(0.01) for _,v in pairs (game:GetService("Players"):GetPlayers()) do if v.Character.humanoid then humanoid.Health = 1
end end |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2011 04:13 PM |
i meant to type: "Heath = i"
my bad |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2011 04:13 PM |
while true do wait(10) for _,v in pairs (game:GetService("Players"):GetPlayers()) do if v.Character.humanoid then for i = 100,0,-1 do v.Character.Humanoid.Health = i end end end
~~ In Soviet Russia, scripts write you. ~~ |
|
|
| Report Abuse |
|
|
|
| 19 Aug 2011 04:14 PM |
whoops. That might crash your game. sorry.
while true do wait(10) for _,v in pairs (game:GetService("Players"):GetPlayers()) do if v.Character.humanoid then for i = 100,0,-1 do v.Character.Humanoid.Health = i wait() end end end
~~ In Soviet Russia, scripts write you. ~~ |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 19 Aug 2011 04:16 PM |
Myrco's right, this is hard for a beginner with almost no experience. Not trying to be mean, but myrco is right, you need to do some reading up.
~~ In Soviet Russia, scripts write you. ~~ |
|
|
| Report Abuse |
|
|