generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Can someone help me fix this?

Previous Thread :: Next Thread 
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
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
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
22 Apr 2012 01:48 PM
Its telling me it can't index the boss.
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
22 Apr 2012 01:50 PM
Please can someone help me?
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
22 Apr 2012 02:01 PM
Bump
Report Abuse
socccerstar is not online. socccerstar
Joined: 23 Aug 2008
Total Posts: 489
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
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
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
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
22 Apr 2012 02:09 PM
Thats what it says.
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
22 Apr 2012 02:13 PM
Bump
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
22 Apr 2012 02:15 PM
Bump.(Will someone just fix it?)
Report Abuse
socccerstar is not online. socccerstar
Joined: 23 Aug 2008
Total Posts: 489
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
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
22 Apr 2012 02:28 PM
I don't know how to add a string to the table.
Report Abuse
Phellem is not online. 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 is not online. 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
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
22 Apr 2012 03:05 PM
Ugh can someone just fix the script for me I don't know what went wrong.
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
22 Apr 2012 03:08 PM
Bump.(Can someone just fix it?)
Report Abuse
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
22 Apr 2012 03:17 PM
Bump
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
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 is not online. 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
TheRealGlobotLeader is not online. TheRealGlobotLeader
Joined: 23 Feb 2011
Total Posts: 5106
22 Apr 2012 05:04 PM
I am trying to bring a boss from the lighting into the workspace.
Report Abuse
Phellem is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image