scrat101
|
  |
| Joined: 26 Jan 2009 |
| Total Posts: 331 |
|
|
| 08 Sep 2011 08:22 PM |
Code: local a, l = pcall( function() local GuiLibrary = LoadLibrary("RbxGui") local PossiblePunishments = {"Ban Player","Walkspeed = -13","Freeze Player","Remove tools","Jail Player","UnFreeze Player"} local PunishList = GuiLibrary.CreateDropDownMenu(PossiblePunishments, function(tex) Punishment = tex end) PunishList.Name = "ListOfPunishments" PunishList.Size = UDim2.new(0, 200,0, 40) PunishList.Position = UDim2.new(0, 190, 0, 180) PunishList.Parent = script.Parent end) if l ~= nil then script.Parent.EnterPlayerName.Text = l end
--Someone answer please! |
|
|
| Report Abuse |
|
|
|
| 08 Sep 2011 08:24 PM |
extra end)?
And I don't think you can use the LoadLibrary() method in pcall |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 08 Sep 2011 08:30 PM |
"And I don't think you can use the LoadLibrary() method in pcall"
Yes you can. Why wouldn't you be able to?
~ pwnedu46 ~ |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 08 Sep 2011 08:31 PM |
@OP: What does the output say. It can sometimes be hard to tell without it.
~ pwnedu46 ~ |
|
|
| Report Abuse |
|
|
|
| 08 Sep 2011 08:36 PM |
@pwnedu: With that output, I wouldn't be so sure. There could be lots of things in that function that will yield that error when used inside pcall.
Could also be the CreateDropDownMenu function, but I'd have to look at the RbxGui CoreScript for that. |
|
|
| Report Abuse |
|
|
scrat101
|
  |
| Joined: 26 Jan 2009 |
| Total Posts: 331 |
|
|
| 08 Sep 2011 08:50 PM |
| The error is: Attempts to yield across the c-call boundary. |
|
|
| Report Abuse |
|
|
scrat101
|
  |
| Joined: 26 Jan 2009 |
| Total Posts: 331 |
|
|
| 08 Sep 2011 08:57 PM |
| I fixed it in Vist mode, but it still fails in online mode. I think LoadLibrary is the issue. are you sure you can call LoadLibrary in online mode? |
|
|
| Report Abuse |
|
|
scrat101
|
  |
| Joined: 26 Jan 2009 |
| Total Posts: 331 |
|
| |
|
|
| 10 Sep 2011 01:06 AM |
| You can't call wait from inside a pcall. |
|
|
| Report Abuse |
|
|
|
| 10 Sep 2011 01:07 AM |
| To elaborate:I assume that the internal scripts for the API use waits, and since you are calling them from a pcall it errors. Use coroutines instead. |
|
|
| Report Abuse |
|
|
scrat101
|
  |
| Joined: 26 Jan 2009 |
| Total Posts: 331 |
|
|
| 11 Sep 2011 02:55 PM |
| Thanks. I will try that! :D :D :D |
|
|
| Report Abuse |
|
|