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: LoadInstance(string) problem

Previous Thread :: Next Thread 
carbondudeoxide is not online. carbondudeoxide
Joined: 04 Mar 2011
Total Posts: 556
23 May 2012 06:42 AM
hi guys ive got this loadinstance thingy here for my store


its ment to load a model with bool values inside it but its not finding any instance :(

can anyone see whats wrong?

(the rest of the script works fine when loading the players score its just the store part :(
local ShopStuff
if not pcall(function() ShopStuff = player:LoadInstance("ShopStuff") end) then
print("making store data")
ShopStuff = Instance.new("Model")
ShopStuff.Name = "Shop"

local mid = Instance.new("BoolValue")
mid.Value = false
mid.Name = "Midway"
mid.Parent = ShopStuff
print("made store data")
end
Report Abuse
carbondudeoxide is not online. carbondudeoxide
Joined: 04 Mar 2011
Total Posts: 556
23 May 2012 12:50 PM
bump
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
23 May 2012 12:51 PM
You should put something like
player:WaitForDataReady()
Report Abuse
carbondudeoxide is not online. carbondudeoxide
Joined: 04 Mar 2011
Total Posts: 556
23 May 2012 04:30 PM
there is i forgot to put it in here though

function beginLoadingData(player)
print("starting")
player:WaitForDataReady()
local KOs
if not pcall(function() KOs = player:LoadNumber("KOs") end) then
KOs = 0
end
local WOs
if not pcall(function() WOs = player:LoadNumber("WOs") end) then
WOs = 0
end
local Points
if not pcall(function() Points = player:LoadNumber("Points") end) then
Points = 0
end

thats the begining part of that script after that it wont work with the loadinstance :(
Report Abuse
carbondudeoxide is not online. carbondudeoxide
Joined: 04 Mar 2011
Total Posts: 556
24 May 2012 09:59 AM
can some one send how they would use the save and load instance thing please :(
Report Abuse
carbondudeoxide is not online. carbondudeoxide
Joined: 04 Mar 2011
Total Posts: 556
24 May 2012 10:19 AM
function beginLoadingData(player)
print("starting")
player:WaitForDataReady()
local KOs
if not pcall(function() KOs = player:LoadNumber("KOs") end) then KOs = 0 end
local WOs
if not pcall(function() WOs = player:LoadNumber("WOs") end) then WOs = 0 end
local Points
if not pcall(function() Points = player:LoadNumber("Points") end) then Points = 0 end
local shop
if not pcall(function() shop = player:LoadNumber("ShopData") end) then shop = nil end

while (not player:findFirstChild("leaderstats")) do wait() end
if (player:findFirstChild("leaderstats")) then
print("found leader stats")
player.leaderstats.KOs.Value = KOs
player.leaderstats.WOs.Value = WOs
player.leaderstats.Points.Value = Points
--ShopStuff.Parent = player.leaderstats
end
if (shop) then
for i,v in pairs(player.leaderstats.Points:getChildren()) do
local nameofaspect = shop:findFirstChild(v.Name)
if (nameofaspect) then
v.Value = nameofaspect.Value
end
end
print("Shop data loaded")
end



can anyone see any problems with this? if not then its gona be uploaded like this :)
Report Abuse
carbondudeoxide is not online. carbondudeoxide
Joined: 04 Mar 2011
Total Posts: 556
24 May 2012 12:14 PM
bump
Report Abuse
carbondudeoxide is not online. carbondudeoxide
Joined: 04 Mar 2011
Total Posts: 556
24 May 2012 04:33 PM
bump
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