|
| 22 Apr 2012 01:46 PM |
BadgetId = 77812097 Bosses = {"Boss1"} while true do wait() Battle = workspace.Boss Health = workspace.Boss.Health.Value
if Health < 0 then
Boss = Bosses[math.random(1,#Bosses)] Boss.Name = "Boss" wait(1) Boss:makeJoints()
Boss.Parent = game.Workspace
b = game:GetService("BadgeService")
b:AwardBadge(p.userId,BadgetId)
local e = Instance.new("Explosion",Battle)
e.BlastPressure = 1000
e.BlastRadius = 100
e.Position = Battle.MainPart.Position wait(1) Battle:Remove() end end
if Boss == "Boss1" then game.Lighting.Boss1:Clone() end |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2012 01:48 PM |
| Its telling me it can't index the boss. |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2012 01:50 PM |
| Please can someone help me? |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Apr 2012 02:05 PM |
| What does your output say exactly. Copy + paste. Also, it should tell you a line number, putting in a comment at that line would be very helpful. |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2012 02:09 PM |
15:08:48 - Workspace.Boss Chooser:10: attempt to index global 'Boss' (a string value) 15:08:48 - Script "Workspace.Boss Chooser", Line 10 15:08:48 - stack end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 22 Apr 2012 02:15 PM |
| Bump.(Will someone just fix it?) |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2012 02:25 PM |
| Okay, you put a string "Boss1" inside table "Bosses", and then you try to set it's name, :makeJoints(), and do a bunch of stuff you can't do with a string. You have to either A) make "Boss1" be something like game.Lighting.Boss1, or B) instead of going straight to Boss.Name... go new_boss = game.Lighting["Boss1"] or something like that. Does that help? |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2012 02:28 PM |
| I don't know how to add a string to the table. |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 22 Apr 2012 02:33 PM |
Here's the problem... [Bad explanation time] By saying 'Bosses[math.random(1,#Bosses)]' you just want the name of the string. Bosses[math.random(1,#Bosses)] is not a model. It's "Boss1"
Try this:
local Bosses = {game.Lighting.Boss1}
--Code
local Boss = Bosses[math.random(1,#Bosses)]:clone() Boss.Name = "Boss"
--Code |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 22 Apr 2012 02:34 PM |
Arg... late post. forget my post. Listen to the previous guy. |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2012 03:05 PM |
| Ugh can someone just fix the script for me I don't know what went wrong. |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2012 03:08 PM |
| Bump.(Can someone just fix it?) |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Apr 2012 03:38 PM |
| How can you not get this? Boss is set to a string, it has no idea about any other models. |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 22 Apr 2012 04:48 PM |
We can't fix it because we don't know what you are bringing to workspace...
"Bosses = {"Boss1"} while true do wait() Battle = workspace.Boss Health = workspace.Boss.Health.Value
if Health < 0 then
Boss = Bosses[math.random(1,#Bosses)] Boss.Name = "Boss" wait(1) Boss:makeJoints()
Boss.Parent = game.Workspace"
LISTEN CLOSE! Bosses = {"Boss1"} Boss = Bosses[math.random(1,#Bosses)]
So Boss is Bosses[math.random(1,#Bosses)] now. Bosses[math.random(1,#Bosses)] is "Boss1" String are stuff in quotes...
So what you are trying to do is this.
Boss = "Boss1" Boss.Name = "Boss" wait(1) Boss:makeJoints()
Boss.Parent = game.Workspace"
Which does not make sense... You made Boss into a string. The string is "Boss1" You tried to make "Boss1" name = to "Boss"... "Boss1".Name = "Boss"
That does not make sense...
|
|
|
| Report Abuse |
|
|
|
| 22 Apr 2012 05:04 PM |
| I am trying to bring a boss from the lighting into the workspace. |
|
|
| Report Abuse |
|
|
Phellem
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 1984 |
|
|
| 22 Apr 2012 05:07 PM |
local BadgetId = 77812097 local Bosses = {"Boss1"} while wait() do local Battle = workspace.Boss local Health = workspace.Boss.Health.Value
if Health < 0 then
local Boss = game.Lighting[Bosses[math.random(1,#Bosses)]]:clone() Boss.Name = "Boss" wait(1) Boss:MakeJoints() Boss.Parent = game.Workspace
local b = game:GetService("BadgeService") b:AwardBadge(p.userId,BadgetId)
local e = Instance.new("Explosion",Battle) e.BlastPressure = 1000 e.BlastRadius = 100 e.Position = Battle.MainPart.Position wait(1) Battle:Remove() end end
|
|
|
| Report Abuse |
|
|