|
| 17 Jun 2012 08:27 AM |
This is a local script. The thing is it NEVER even starts the loop. I cannot understand why though?
wait(3) questHold = script.Parent.QuestHold questInfo = script.Parent.QuestInfo.QuestInfo questName = questInfo.QuestName questInformation = questInfo.QuestInformation player = game.Players.LocalPlayer
for i,quest in pairs(_G.quests) do local questId = quest[1] local questTitle = quest[2] local questDesc = quest[3] local button = script.QuestButton:clone() print("Created button") button.Text = questTitle button.Position = UDim2.new(0,0,(questId-1)/10,0) button.Parent = questHold print("Button Parented") button.Name = "Quest"..questId if button then print("Button found") button.MouseButton1Down:connect(function() print("Button pressed for questId"..questId) print(questDesc) questInfo.Position = UDim2.new(-1,0,0,0) questName.Text = questTitle.. " ["..questId.."]"
if player:FindFirstChild("Quest"..questId.."Completed") then questInformation.Text = questDesc.. " [Completed]" questName.TextColor3 = Color3.new(0,1,0) end
if player:FindFirstChild("Quest"..questId) then if player:FindFirstChild("Quest"..questId).Value then questInformation.Text = questDesc.. " [Collect Reward]" else questInformation.Text = questDesc.. " [Ongoing]" questName.TextColor3 = Color3.new(1,1,1) end end
if player:FindFirstChild("Quest"..questId.."Completed") == nil and player:FindFirstChild("Quest"..questId) == nil then questInformation.Text = questDesc.. " [Not Given]" questName.TextColor3 = Color3.new(1,0,0) end print("Moving") questInfo:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 3,true,function() print("Finished") end) end) end end
It works in solo but not online. I'll add credits for fixers :P -[ RS ]- |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2012 08:33 AM |
It's possible that _G.quests is empty because this localscript starts sooner than whatever populates that.
The reason that may happen is because of the script populating it may error if there are no players in the place or something like that (that doesn't happen in Test-Solo).
Is there no output? |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2012 10:04 AM |
I put a print("Quests started") at the top of the script and it never prints quest started in the output :P
-[ RS ]- |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 17 Jun 2012 11:21 AM |
questInfo:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quad", 3,true,function()
That line maybe |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 17 Jun 2012 11:23 AM |
| It's the _G table. You shouldn't even try to access it in a local script. There are so many complications. |
|
|
| Report Abuse |
|
|
|
| 17 Jun 2012 11:52 AM |
^ DOH Never though of that. Back to the inefficent ways :P
-[ RS ]- |
|
|
| Report Abuse |
|
|