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
|
  |
| 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
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 896 |
|
| |
|
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
|
  |
| 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
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 896 |
|
| |
|
IlIll
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 896 |
|
| |
|
IlIll
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 896 |
|
| |
|
|
| 27 May 2012 03:25 PM |
| IlIll, i dont get what you asking for. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 896 |
|
|
| 27 May 2012 06:58 PM |
| Thank you!!! It works now :) |
|
|
| Report Abuse |
|
|
|
| 27 May 2012 07:03 PM |
| ALWAYS use :FindFirstChild() when checking to see if it in fact exists. |
|
|
| Report Abuse |
|
|