|
| 26 Feb 2013 10:44 PM |
---------- --Components--
--Values local Range = script.Parent.Range.Value local Damage = script.Parent.Damage.Value local Time = script.Parent.Time.Value
--Parts local Node = script.Parent.MainPart
--Tables local players = {}
--Components-- ----------
--------- --Functions--
--Adding Joining Players to Table 'players' game.Players.PlayerAdded:connect(function(player) table.insert(players,v) end)
--Finding players in range while true do wait() for i,c in pairs (players) do local char = c.Character if (char.Torso.Position - Node.Position).magnitude <= Radius then while char.Humanoid.Health > 0 and (char.Torso.Position - Cone.Position).magnitude <= Range do char.Humanoid.Health = char.Humanoid.Health - Damage print(c.Name .. " Damaged by " .. Damage) wait(Time) end end end end
--Functions-- --------- |
|
|
| Report Abuse |
|
|
th3oracle
|
  |
| Joined: 23 Feb 2013 |
| Total Posts: 448 |
|
| |
|
|
| 26 Feb 2013 10:47 PM |
| What are you asking? Where is the output? Why did you not read and abide by the rules here?... |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 26 Feb 2013 10:48 PM |
table.insert(players, player.Name)
for i,c in pairs (players) do local char = c.Character players is a table so you're going to have to hardcode it. for i,c in pairs (players) do local char = game.Players[c.Name].Character
I believe that should work.. |
|
|
| Report Abuse |
|
|
|
| 26 Feb 2013 10:52 PM |
| Thanks Xnite, I'll try it and get back to you. And christbru, there was no output, if there was I would've said so. And of course I abide by the rules. There's no need to be like that. I included what I thought was necessary for people to properly fix the problem, if you don't have anything helpful, why even visit this forum? |
|
|
| Report Abuse |
|
|
|
| 26 Feb 2013 10:56 PM |
| I am here because I can help most anyone with scripting... Though I need something to help, and there is nothing that you posted besides a script and a title which doesn't explain much either... just a simple 'I am trying to get this to do suchandsuch and it is not working, help?' would have been useful :P Also, if no output then why not state as much? >.> |
|
|
| Report Abuse |
|
|
|
| 26 Feb 2013 10:58 PM |
http://www.roblox.com/Forum/ShowPost.aspx?PostID=80625843
Simply reading that, which is stickyed on top of the Scripting Helpers forum which this is in, will show you exactly what I am talking about... |
|
|
| Report Abuse |
|
|
|
| 26 Feb 2013 11:07 PM |
Right. I'm sorry I kinda over reacted. :/ And I thought I had written something else above and below the script but I guess not. I was just kinda in a hurry to get this thing done. That's been happening lately. Again I'm sorry for talki...typing... to you that way, I'll make sure of things next time.
And Xnite, the only problem with the fix you gave me was game.Players[c.Name].Character didn't work because it expected a string in the brackets. I fixed it by replacing it with game.Players:findFirstChild(c).Character and now it works perfectly, other than the over time thing which was only for testing and doesn't need to be there.
Thanks to both of you for helping me with completely different things, one of you with the script, the other with my brain...
Note: There was no sarcasm here, it can seem like there is sometimes... |
|
|
| Report Abuse |
|
|