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: Whats wrong?

Previous Thread :: Next Thread 
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
10 Jul 2011 10:57 PM
Whats wrong with my DP script?

--Save--

PlayedPlayer = script.Parent.Parent.Parent.Parent.Parent
Value1 = PlayedPlayer:findFirstChild("MoneyValue")
Value2 = PlayedPlayer:findFirstChild("KillValue")
script.Parent.MouseButton1Down:connect(function()
if Value1 ~= nil then
PlayedPlayer:SaveNumber("MoneyValue", Value1.Value)
end
if Value2 ~= nil then
PlayedPlayer:SaveNumber("KillValue", Value2.Value)
end
end)

--Load--

PlayedPlayer = script.Parent.Parent.Parent.Parent.Parent
Value1 = PlayedPlayer:findFirstChild("MoneyValue")
Value2 = PlayedPlayer:findFirstChild("KillValue")
script.Parent.MouseButton1Down:connect(function()
if Value1 ~= nil then
Value1.Value = PlayedPlayer:LoadNumber("MoneyValue")
end
if Value2 ~= nil then
Value2.Value = PlayedPlayer:LoadNumber("KillValue")
end
end)
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
10 Jul 2011 10:58 PM
--[[BUMP]]--
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
10 Jul 2011 11:03 PM
Bump :3
Report Abuse
Jinxy is not online. Jinxy
Joined: 04 Aug 2007
Total Posts: 18317
10 Jul 2011 11:12 PM
Not many "pro" scripters are online.... I'll try and help you.
Report Abuse
Jinxy is not online. Jinxy
Joined: 04 Aug 2007
Total Posts: 18317
10 Jul 2011 11:14 PM
Did you define what "PlayedPlayer" was?
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
10 Jul 2011 11:16 PM
I don't see anything wrong, but anonymous functions never work in my favor..
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
10 Jul 2011 11:17 PM
Wait lol I think you need a WaitForDataReady() somewhere in there xD
Report Abuse
Jinxy is not online. Jinxy
Joined: 04 Aug 2007
Total Posts: 18317
10 Jul 2011 11:19 PM
Perhaps at the begining?
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
10 Jul 2011 11:20 PM
I'm pretty sure not at the beginning. :3
Report Abuse
Jinxy is not online. Jinxy
Joined: 04 Aug 2007
Total Posts: 18317
10 Jul 2011 11:21 PM
/me doesn't know about DP enough to be commenting, really.
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
10 Jul 2011 11:24 PM
try pcall
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
10 Jul 2011 11:25 PM
I will try to Mitch to fix it :3
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
10 Jul 2011 11:27 PM
Hes not online >.<
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
10 Jul 2011 11:28 PM
http://wiki.roblox.com/index.php/ROBLOX_Scripting_How_To:_Data_Persistence

I just read it, DP is really easy... but yeah. pcall() should help.
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
10 Jul 2011 11:31 PM
@Chicken

I added something (Nawt pcall()) please help me test :3
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
10 Jul 2011 11:36 PM
PlayedPlayer = script.Parent.Parent.Parent.Parent.Parent
Value1 = PlayedPlayer:findFirstChild("MoneyValue")
Value2 = PlayedPlayer:findFirstChild("KillValue")
script.Parent.MouseButton1Down:connect(function()
if Value1 ~= nil then
PlayedPlayer:SaveNumber("MoneyValue", Value1.Value)
end
if Value2 ~= nil then
PlayedPlayer:SaveNumber("KillValue", Value2.Value)
end
end)

pcall(script.Parent.MouseButton1Down:connect(function()
if Value1 ~= nil then
PlayedPlayer:SaveNumber("MoneyValue", Value1.Value)
end
if Value2 ~= nil then
PlayedPlayer:SaveNumber("KillValue", Value2.Value)
end
end))

--Load--

PlayedPlayer = script.Parent.Parent.Parent.Parent.Parent
Value1 = PlayedPlayer:findFirstChild("MoneyValue")
Value2 = PlayedPlayer:findFirstChild("KillValue")
script.Parent.MouseButton1Down:connect(function()
if Value1 ~= nil then
Value1.Value = PlayedPlayer:LoadNumber("MoneyValue")
end
if Value2 ~= nil then
Value2.Value = PlayedPlayer:LoadNumber("KillValue")
end
end)

pcall(script.Parent.MouseButton1Down:connect(function()
if Value1 ~= nil then
Value1.Value = PlayedPlayer:LoadNumber("MoneyValue")
end
if Value2 ~= nil then
Value2.Value = PlayedPlayer:LoadNumber("KillValue")
end
end))
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
10 Jul 2011 11:42 PM
Come back to test your script please.
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
10 Jul 2011 11:43 PM
Please :D!
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
10 Jul 2011 11:43 PM
Run this in build mode and see what the output says:

PlayedPlayer = script.Parent.Parent.Parent.Parent.Parent
Value1 = PlayedPlayer:findFirstChild("MoneyValue")
Value2 = PlayedPlayer:findFirstChild("KillValue")
script.Parent.MouseButton1Down:connect(function()
if Value1 ~= nil then
PlayedPlayer:SaveNumber("MoneyValue", Value1.Value)
end
if Value2 ~= nil then
PlayedPlayer:SaveNumber("KillValue", Value2.Value)
end
end)

pcal=pcall(script.Parent.MouseButton1Down:connect(function()
if Value1 ~= nil then
PlayedPlayer:SaveNumber("MoneyValue", Value1.Value)
end
if Value2 ~= nil then
PlayedPlayer:SaveNumber("KillValue", Value2.Value)
end
end))
print(pcal)

--Load--

PlayedPlayer = script.Parent.Parent.Parent.Parent.Parent
Value1 = PlayedPlayer:findFirstChild("MoneyValue")
Value2 = PlayedPlayer:findFirstChild("KillValue")
script.Parent.MouseButton1Down:connect(function()
if Value1 ~= nil then
Value1.Value = PlayedPlayer:LoadNumber("MoneyValue")
end
if Value2 ~= nil then
Value2.Value = PlayedPlayer:LoadNumber("KillValue")
end
end)

pca=pcall(script.Parent.MouseButton1Down:connect(function()
if Value1 ~= nil then
Value1.Value = PlayedPlayer:LoadNumber("MoneyValue")
end
if Value2 ~= nil then
Value2.Value = PlayedPlayer:LoadNumber("KillValue")
end
end))
print(pca)
Report Abuse
PrinceCamelot is not online. PrinceCamelot
Joined: 08 Jul 2011
Total Posts: 489
10 Jul 2011 11:50 PM
Chicken I am waiting for you :3
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