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
 

Re: Works on solo, not online.

Previous Thread :: Next Thread 
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
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
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
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
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
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
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
17 Jun 2012 10:44 AM
Bump

-[ RS ]-
Report Abuse
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
17 Jun 2012 11:14 AM
Bump

-[ RS ]-
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
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 is not online. 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
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
17 Jun 2012 11:52 AM
^ DOH Never though of that. Back to the inefficent ways :P

-[ RS ]-
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