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
 

Reply

Previous Thread :: Next Thread 
IlIll is not online. IlIll
Joined: 28 Aug 2011
Total Posts: 896
26 May 2012 10:27 PM
My script doesn't really work... you see where I tell it to continue ONLY if the thing is object is absent? well it continues by saying that rattata isn't a valid member. OF COURSE IT ISN'T! It isn't even intended to be a valid member!
please don't add another if! it'll ruin my elseifs (that aren't included right now)


function onButton1Down(mouse)
local hit=mouse.Target
if hit~=nil then
if script.Parent.Parent.Parent:FindFirstChild("Pokes").Value <=6 then
if hit.Parent.Name == "Rattata" and game.Players[script.Parent.Parent.Parent.Name].PlayerGui.Pokemon.Frame[hit.Parent.Name] == nil then
P = game.Lighting.Pokeball.Rattata:clone()
P.Parent = script.Parent.Parent.Parent.PlayerGui.Pokemon.Frame
P.Image = "http://www.roblox.com/asset/?id=43363907"
P.Ball.Value = "http://www.roblox.com/asset/?id=43363907"
print ("invisible")
P.Visible = false
local h = Instance.new("Hint")
h.Text = (""..game.Players.LocalPlayer.Name.." caught a Rattata!")
h.Parent = game.Workspace
hit.Parent.Head:remove()
game:GetService("Debris"):AddItem(h,5)
num = script.Parent.Parent.Parent:FindFirstChild("Pokes")
num.Value = num.Value +1
print ("plus-ed")
poke = ("Poke"..num.Value.."")
print ("poke")
pone = script.Parent.Parent.Parent:FindFirstChild("PlayerGui").Gui.Menu.Roster.Items[poke]
print ("1")
PMon = P.Pokemon.Value
photo = game.Lighting.Pokemon[PMon].Picture.Value
pone.Img.Image = photo
pone.Title.Text = PMon
plop = script.Parent.Parent.Parent:FindFirstChild("p"..num.Value.."")
plop.Value = PMon
rum = P.number
rum.Value = num.Value
print ("roster is go!")
script.Parent:remove()
end
end
end
end
function onSelected(mouse)
mouse.Button1Down:connect(function () onButton1Down(mouse) end)
end
script.Parent.Selected:connect(onSelected)
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
26 May 2012 10:33 PM
It says nil if you have a value (E.X: IntValue) I think
It says not a valid member if you do something like this:
List of workspace:
Part
Script
Inside script:
b = game.Workspace.Lololol:Clone()
b.Parent = game.Lighting

Output:
>>Lololol is not a valid member of Workspace
game.Workspace.Script.Line:1
Stack end
Report Abuse
IlIll is not online. IlIll
Joined: 28 Aug 2011
Total Posts: 896
26 May 2012 11:08 PM
...I'm confused
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
26 May 2012 11:45 PM
Rattata isn't valid member = scripty no worky
Report Abuse
IlIll is not online. IlIll
Joined: 28 Aug 2011
Total Posts: 896
27 May 2012 10:27 AM
But I want it to continue if he's absent - which he is and thus he's not a member of Frame...
Report Abuse
IlIll is not online. IlIll
Joined: 28 Aug 2011
Total Posts: 896
27 May 2012 12:50 PM
Bump
Report Abuse
IlIll is not online. IlIll
Joined: 28 Aug 2011
Total Posts: 896
27 May 2012 02:10 PM
bump
Report Abuse
IlIll is not online. IlIll
Joined: 28 Aug 2011
Total Posts: 896
27 May 2012 03:17 PM
Still need help...
Report Abuse
TheRedAngel is not online. TheRedAngel
Joined: 17 Apr 2012
Total Posts: 471
27 May 2012 03:25 PM
IlIll, i dont get what you asking for.
Report Abuse
IlIll is not online. IlIll
Joined: 28 Aug 2011
Total Posts: 896
27 May 2012 04:38 PM
The script ends because apparently Rattata isn't a valid member of Frame
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
27 May 2012 04:45 PM
game.Players[script.Parent.Parent.Parent.Name].PlayerGui.Pokemon.Frame[hit.Parent.Name] == nil


Change to:


game.Players[script.Parent.Parent.Parent.Name].PlayerGui.Pokemon.Frame:FindFirstChild(hit.Parent.Name) == nil
Report Abuse
IlIll is not online. IlIll
Joined: 28 Aug 2011
Total Posts: 896
27 May 2012 06:58 PM
Thank you!!! It works now :)
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
27 May 2012 07:03 PM
ALWAYS use :FindFirstChild() when checking to see if it in fact exists.
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