|
| 01 May 2012 04:04 PM |
Okay, so im developing a script i call a HOTIR, it stands for Heal Over Time In Range. So basically, im trying to get the script to work and heal the player for being within a certain range of a model or block for a set amount of hp every like....2 seconds, i have included a Range value with the script and a variable pointing to the Range value and its value for the distance away you have to be. but i am having problems getting it to work. the Output box is telling me i cannot have multiple group ID's so i fixed that and re-ran the script and it came up with another problem, so i fixed that and it came up with yet another problem so i eventually gave up and came here. if you can fix the script or want to try and fix the script, please visit my models and take the HOTIR model. i would greatly appreciate if someone fixes this script so that i can use it to better enhance my places. if you end up fixing the script so that it properly heals you only when you are within range of the item please PM me so that i can receive the script. |
|
|
| Report Abuse |
|
|
MrMcAero
|
  |
| Joined: 21 Apr 2012 |
| Total Posts: 671 |
|
|
| 01 May 2012 04:11 PM |
Post script and output log here.
- Cheers! |
|
|
| Report Abuse |
|
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 01 May 2012 04:18 PM |
healer = game.Workspace.HealBlock maxdistance = 10 healthbonus = 2
while wait(2) do for i, plr in pairs(game.Playes:GetPlayers()) do mag = (plr.Position - healer.Position).magnitude if mag < maxdistance and plr.Character.Humanoid.Health < plr.Character.Humanoid.MaxHealth then plr.Character.Humanoid.Health = plr.Character.Humanoid.Health + healthbonus end end end
May not work, but it's worth a shot. |
|
|
| Report Abuse |
|
|
|
| 01 May 2012 04:34 PM |
Mmk... I'll try it Script and Output Log are coming right up |
|
|
| Report Abuse |
|
|
|
| 01 May 2012 04:36 PM |
Heres The output Log :
17:35:53 - Workspace.Assassins Brigade battle Standard.Battle Standard:1: ')' expected near ','
Heres The Script :
Groups = (150631, 277680, 538849, 213339, 237373, 191104, 196234) range = script.Parent.Range.Value
wait(1) while true do if (torso.Position-bin.Position).magnitude <= range and p:IsInGroup(Groups) then local humanoid = part.Parent:FindFirstChild("Humanoid") if (humanoid ~= nil) then humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) humanoid.Health = humanoid.Health +15 wait(2) end end
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
DeVinci
|
  |
| Joined: 21 Jul 2010 |
| Total Posts: 338 |
|
|
| 02 May 2012 05:01 PM |
| Instead of having 1000+ lines of the same code, use a while true do with an if statement to see if the players health isnt maxed, and if range, and both are true, then heal. |
|
|
| Report Abuse |
|
|
|
| 02 May 2012 05:02 PM |
| Mmmk so then the 1 line of heal will repeat until they are max health. |
|
|
| Report Abuse |
|
|
DeVinci
|
  |
| Joined: 21 Jul 2010 |
| Total Posts: 338 |
|
| |
|