|
| 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 |
|
|
| |
|
| |
|
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
|
  |
| Joined: 04 Aug 2007 |
| Total Posts: 18317 |
|
|
| 10 Jul 2011 11:14 PM |
| Did you define what "PlayedPlayer" was? |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2011 11:16 PM |
| I don't see anything wrong, but anonymous functions never work in my favor.. |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2011 11:17 PM |
| Wait lol I think you need a WaitForDataReady() somewhere in there xD |
|
|
| Report Abuse |
|
|
Jinxy
|
  |
| Joined: 04 Aug 2007 |
| Total Posts: 18317 |
|
| |
|
|
| 10 Jul 2011 11:20 PM |
| I'm pretty sure not at the beginning. :3 |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
|
| 10 Jul 2011 11:25 PM |
| I will try to Mitch to fix it :3 |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 10 Jul 2011 11:31 PM |
@Chicken
I added something (Nawt pcall()) please help me test :3 |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 10 Jul 2011 11:42 PM |
| Come back to test your script please. |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 10 Jul 2011 11:50 PM |
| Chicken I am waiting for you :3 |
|
|
| Report Abuse |
|
|