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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Whats wrong with my script

Previous Thread :: Next Thread 
killerbolx is not online. killerbolx
Joined: 10 Sep 2009
Total Posts: 6135
31 Aug 2011 10:06 AM
could anyone please help?

here is the script


function Scan(potato)
if Broccoli:IsA("BasePart") then
if((Broccoli:FindFirstChild("Mesh"))==true)then
if(Broccoli.Mesh:IsA("FileMesh"))then
Broccoli.Mesh.TextureId="http://www.roblox.com/asset/?id="
Broccoli.Color=Color3.new(0,1,0)
Broccoli.Transparency=0.5
end
else
Broccoli.Transparency=1
Broccoli .CanCollide = true
Broccoli.Anchored = true
local sb=Instance.new("SelectionBox")
b = Instance.new("SelectionBox", Broccoli)
b.Adornee = Broccoli
b.Color = Broccoli.BrickColor
end
end
end

end
elseif(Broccoli:IsA("Model"))then
local gg=Broccoli:GetChildren()
if(#gg)==0 then
return
end
for x=1,#gg do
find(gg[x])
end
elseif(Broccoli:IsA("Tool"))then
local gg=Broccoli:GetChildren()
if(#gg)==0 then
return
end
for x=1,#gg do
find(gg[x])
end
elseif(Broccoli:IsA("CharacterMesh"))then
Broccoli.BaseTextureId=0
Broccoli.OverlayTextureId=0
elseif(Broccoli:IsA("Hat"))then
local gg=Broccoli:GetChildren()
if(#gg)==0 then
return
end
for x=1,#gg do
find(gg[x])
end
end
Broccoli.ChildAdded:connect(C)
end
function C(child)
find(child)--lol
end
Workspace.ChildAdded:connect(C)
local g=Workspace:getChildren()
for i=1,#g do
find(g[i])
end
Report Abuse
killerbolx is not online. killerbolx
Joined: 10 Sep 2009
Total Posts: 6135
31 Aug 2011 10:09 AM
what is supposed to do is make bricks neon by inserting selections boxes in each part and the selection box is supposed to be the same color as the brick and the brick is supposed to be made transparent
Report Abuse
pokelord910 is not online. pokelord910
Joined: 26 May 2009
Total Posts: 1045
31 Aug 2011 10:09 AM
umm.... output?
Report Abuse
killerbolx is not online. killerbolx
Joined: 10 Sep 2009
Total Posts: 6135
31 Aug 2011 10:10 AM
Wed Aug 31 12:04:40 2011 - Running Script "Workspace.Script"
Wed Aug 31 12:04:40 2011 - Workspace.Script:21: '< eof
>' expected near 'end'
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
31 Aug 2011 10:10 AM
Output?
Report Abuse
killerbolx is not online. killerbolx
Joined: 10 Sep 2009
Total Posts: 6135
31 Aug 2011 10:11 AM
i spaced it so that roblox would not block it
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
31 Aug 2011 10:11 AM
It means you have to rid of at least one end.
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
31 Aug 2011 10:11 AM
Srry late post D:
Report Abuse
killerbolx is not online. killerbolx
Joined: 10 Sep 2009
Total Posts: 6135
31 Aug 2011 10:12 AM
could someone fix it for me?
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
31 Aug 2011 10:13 AM
end
elseif(Broccoli:IsA("Model"))then


The end is not necessary. Three if statements and a function. Four ends. The fifth end is not necessary.
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
31 Aug 2011 10:14 AM
Also, for an elseif, you need to rid of another end. Do not end the 'if' before the 'else'/'elseif'.
Report Abuse
killerbolx is not online. killerbolx
Joined: 10 Sep 2009
Total Posts: 6135
31 Aug 2011 10:15 AM
so what do i do now?
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
31 Aug 2011 10:16 AM
Well, I can continue to fix it if you explain what 'if''s each else/elseif goes to..
Report Abuse
killerbolx is not online. killerbolx
Joined: 10 Sep 2009
Total Posts: 6135
31 Aug 2011 10:17 AM
could you write out the fixed script and if it does not work ill tell you the output and then you tell me what to change?
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
31 Aug 2011 10:19 AM
My last post will be the same response required.

I will continue to help if you tell me which 'if' statement each 'else' and 'elseif' go to.
Report Abuse
killerbolx is not online. killerbolx
Joined: 10 Sep 2009
Total Posts: 6135
31 Aug 2011 10:19 AM
Wed Aug 31 12:14:08 2011 - Running Script "Workspace.Script"
Wed Aug 31 12:14:08 2011 - Workspace.Script:21: '< eof >' expected near 'elseif'
Report Abuse
killerbolx is not online. killerbolx
Joined: 10 Sep 2009
Total Posts: 6135
31 Aug 2011 10:23 AM
bump
Report Abuse
killerbolx is not online. killerbolx
Joined: 10 Sep 2009
Total Posts: 6135
31 Aug 2011 10:24 AM

elseif(Broccoli:IsA("Model"))then
local gg=Broccoli:GetChildren()
if(#gg)==0 then
return
end
for x=1,#gg do
find(gg[x])
end
elseif(Broccoli:IsA("Tool"))then
local gg=Broccoli:GetChildren()
if(#gg)==0 then
return
end
for x=1,#gg do
find(gg[x])
end
elseif(Broccoli:IsA("CharacterMesh"))then
Broccoli.BaseTextureId=0
Broccoli.OverlayTextureId=0
elseif(Broccoli:IsA("Hat"))then
local gg=Broccoli:GetChildren()
if(#gg)==0 then
return
end
for x=1,#gg do
find(gg[x])
Report Abuse
killerbolx is not online. killerbolx
Joined: 10 Sep 2009
Total Posts: 6135
31 Aug 2011 10:27 AM
elseif(Broccoli:IsA("Model"))then
this is so that if the part is in a model it changes it too
elseif(Broccoli:IsA("Tool"))then
if it is in a tool then it changes it too
elseif(Broccoli:IsA("CharacterMesh"))then
if it is a mesh then it changes it too
elseif(Broccoli:IsA("Hat"))then
if it in a hat then it changes it too
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
31 Aug 2011 10:39 AM
Let us start, here.

function Scan(potato)
if Broccoli:IsA("BasePart") then
if((Broccoli:FindFirstChild("Mesh"))==true)then
if(Broccoli.Mesh:IsA("FileMesh"))then
Broccoli.Mesh.TextureId="http://www.roblox.com/asset/?id="
Broccoli.Color=Color3.new(0,1,0)
Broccoli.Transparency=0.5
end
else
Broccoli.Transparency=1
Broccoli .CanCollide = true
Broccoli.Anchored = true
local sb=Instance.new("SelectionBox")
b = Instance.new("SelectionBox", Broccoli)
b.Adornee = Broccoli
b.Color = Broccoli.BrickColor
end
end -- ONE OF THESE NEED TO GO FOR THE NEXT ELSEIF
end

end -- THIS END NEEDS TO GO
elseif(Broccoli:IsA("Model"))then
local gg=Broccoli:GetChildren()


The first 'else' goes to which 'if'? (At least, which is it supposed to? Right now, it is going to "if((Broccoli:FindFirstChild("Mesh"))==true)then"

By the way, add spaces.

elseif(Broccoli:IsA("Model"))then

Where does that go to? Also, add spaces. "elseif Broccoli:IsA("Model") then"
Report Abuse
killerbolx is not online. killerbolx
Joined: 10 Sep 2009
Total Posts: 6135
31 Aug 2011 10:51 AM
aha figured it out

function find(blue)
if blue:IsA("BasePart") then
if((blue:FindFirstChild("Mesh"))==true)then
if(blue.Mesh:IsA("FileMesh"))then
blue.Mesh.TextureId="http://www.roblox.com/asset/?id="
blue.Color=Color3.new(0,1,0)
blue.Transparency=0.5
end
else
blue.Transparency=1
blue.CanCollide = true
blue.Anchored = true

local sb=Instance.new("SelectionBox")
sb.Parent=blue
sb.Name="Hologram"
sb.Adornee = blue
sb.Color = blue.BrickColor
sb.Transparency=0
end
elseif(blue:IsA("Model"))then
local gg=blue:GetChildren()
if(#gg)==0 then
return
end
for x=1,#gg do
find(gg[x])
end
elseif(blue:IsA("Tool"))then
local gg=blue:GetChildren()
if(#gg)==0 then
return
end
for x=1,#gg do
find(gg[x])
end
elseif(blue:IsA("CharacterMesh"))then
blue.BaseTextureId=0
blue.OverlayTextureId=0
elseif(blue:IsA("Hat"))then
local gg=blue:GetChildren()
if(#gg)==0 then
return
end
for x=1,#gg do
find(gg[x])
end
end
blue.ChildAdded:connect(C)
end
function C(child)
find(child)--lol
end
Workspace.ChildAdded:connect(C)
local g=Workspace:getChildren()
for i=1,#g do
find(g[i])
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