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: Data persistance help

Previous Thread :: Next Thread 
WildcatNation is not online. WildcatNation
Joined: 28 Sep 2010
Total Posts: 1351
04 Aug 2011 07:29 PM
game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
ls = p:FindFirstChild("leaderstats")
if ls nil then
lev = ls:FindFirstChild("Level")
if lev nil then
p:SaveNumber("Level", lev.Value)
end
end
end)


game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
c = p:FindFirstChild("Chats")
if c nil then
p:SaveString("Chats", c.Value)
end
end)



game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
p:SaveBoolean("Played", true)
end)


game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
Model = game.Workspace:FindFirstChild(p.Name.."'s Bricks")
if Model nil then
p:SaveInstance("BuildingBricks", Model)
end
end)


game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
local ls = Instance.new("IntValue", p)
ls.Name = "leaderstats"
local lev = Instance.new("IntValue", ls)
lev.Name = "Level"
SavedLevel = p:LoadNumber("Level")
if SavedLevel == 0 nil then
SavedLevel = 1
end
lev.Value = SavedLevel
end)


game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
Parts = p:LoadInstance("BuildingBricks")
Parts.Parent = game.Workspace
end)



OuTPUT:

Thu Aug 04 19:26:40 2011 - Running Script "Workspace.Script"
Thu Aug 04 19:26:40 2011 - Workspace.Script:4: 'then' expected near 'nil'
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
04 Aug 2011 07:32 PM
if (ls == nil) then
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
04 Aug 2011 07:33 PM
"if ls nil then"

That should be:

if ls == nil then
Report Abuse
ninjabart122 is not online. ninjabart122
Joined: 11 Mar 2008
Total Posts: 3579
04 Aug 2011 07:35 PM
You forgot a whole bunch of "==" in the

if whateverthisis nil then
Report Abuse
WildcatNation is not online. WildcatNation
Joined: 28 Sep 2010
Total Posts: 1351
04 Aug 2011 07:38 PM
I Know But Where is it im tired I mowed The lawn.BTW i live on a Hillside
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
04 Aug 2011 07:39 PM
Just look through the ifs
Report Abuse
WildcatNation is not online. WildcatNation
Joined: 28 Sep 2010
Total Posts: 1351
04 Aug 2011 07:43 PM
game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
ls = p:FindFirstChild("leaderstats")
if (ls== nil) then
lev = ls:FindFirstChild("Level")
if lev nil then
p:SaveNumber("Level", lev.Value)
end
end
end)


game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
c = p:FindFirstChild("Chats")
if c nil then
p:SaveString("Chats", c.Value)
end
end)



game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
p:SaveBoolean("Played", true)
end)


game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
Model = game.Workspace:FindFirstChild(p.Name.."'s Bricks")
if Model nil then
p:SaveInstance("BuildingBricks", Model)
end
end)


game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
local ls = Instance.new("IntValue", p)
ls.Name = "leaderstats"
local lev = Instance.new("IntValue", ls)
lev.Name = "Level"
SavedLevel = p:LoadNumber("Level")
if SavedLevel == 0 nil then
SavedLevel = 1
end
lev.Value = SavedLevel
end)


game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
Parts = p:LoadInstance("BuildingBricks")
Parts.Parent = game.Workspace
end)

Ok Did i Fix it lets find out place!
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
04 Aug 2011 07:43 PM
Or, you could read the output. The first one is on the fourth line.
Report Abuse
xvgigakid is not online. xvgigakid
Joined: 22 Jun 2008
Total Posts: 4407
04 Aug 2011 07:46 PM
if Model nil then
if c nil then

Take your time reading through it dude.
Report Abuse
WildcatNation is not online. WildcatNation
Joined: 28 Sep 2010
Total Posts: 1351
04 Aug 2011 07:49 PM
--WildcatNation with Help of SH Fix--





game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
ls = p:FindFirstChild("leaderstats")
if ls == nil then
lev = ls:FindFirstChild("Level")
if lev nil then
p:SaveNumber("Level", lev.Value)
end
end
end)


game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
c = p:FindFirstChild("Chats")
if c nil then
p:SaveString("Chats", c.Value)
end
end)



game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
p:SaveBoolean("Played", true)
end)


game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
Model = game.Workspace:FindFirstChild(p.Name.."'s Bricks")
if Model nil then
p:SaveInstance("BuildingBricks", Model)
end
end)


game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
local ls = Instance.new("IntValue", p)
ls.Name = "leaderstats"
local lev = Instance.new("IntValue", ls)
lev.Name = "Level"
SavedLevel = p:LoadNumber("Level")
if SavedLevel == 0 nil then
SavedLevel = 1
end
lev.Value = SavedLevel
end)


game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
Parts = p:LoadInstance("BuildingBricks")
Parts.Parent = game.Workspace
end)

Whatever Im Sleepy i'll figure it out tommorow
Report Abuse
WildcatNation is not online. WildcatNation
Joined: 28 Sep 2010
Total Posts: 1351
04 Aug 2011 07:50 PM
--WildcatNation with Help of SH Fix--





game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
ls = p:FindFirstChild("leaderstats")
if ls == nil then
lev = ls:FindFirstChild("Level")
if lev nil then
p:SaveNumber("Level", lev.Value)
end
end
end)


game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
c = p:FindFirstChild("Chats")
if c nil then
p:SaveString("Chats", c.Value)
end
end)



game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
p:SaveBoolean("Played", true)
end)


game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
Model = game.Workspace:FindFirstChild(p.Name.."'s Bricks")
if Model == nil then
p:SaveInstance("BuildingBricks", Model)
end
end)


game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
local ls = Instance.new("IntValue", p)
ls.Name = "leaderstats"
local lev = Instance.new("IntValue", ls)
lev.Name = "Level"
SavedLevel = p:LoadNumber("Level")
if SavedLevel == 0 nil then
SavedLevel = 1
end
lev.Value = SavedLevel
end)


game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
Parts = p:LoadInstance("BuildingBricks")
Parts.Parent = game.Workspace
end)

Alright I think i fixed it.Thanks guys
Report Abuse
WildcatNation is not online. WildcatNation
Joined: 28 Sep 2010
Total Posts: 1351
04 Aug 2011 07:54 PM
game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
ls = p:FindFirstChild("leaderstats")
if ls == nil then
lev = ls:FindFirstChild("Level")
if lev nil then
p:SaveNumber("Level", lev.Value)
end
end
end)


game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
c = p:FindFirstChild("Chats")
if c nil then
p:SaveString("Chats", c.Value)
end
end)



game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
p:SaveBoolean("Played", true)
end)


game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
Model = game.Workspace:FindFirstChild(p.Name.."'s Bricks")
if Model nil then
p:SaveInstance("BuildingBricks", Model)
end
end)


game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
local ls = Instance.new("IntValue", p)
ls.Name = "leaderstats"
local lev = Instance.new("IntValue", ls)
lev.Name = "Level"
SavedLevel = p:LoadNumber("Level")
if SavedLevel == 0 nil then
SavedLevel = 1
end
lev.Value = SavedLevel
end)


game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
Parts = p:LoadInstance("BuildingBricks")
Parts.Parent = game.Workspace
end)


Report Abuse
WildcatNation is not online. WildcatNation
Joined: 28 Sep 2010
Total Posts: 1351
04 Aug 2011 07:56 PM
NVm fixed Thanks guys man im tired Cee Ya Tommorow
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