|
| 03 Aug 2014 05:36 PM |
4th thread on this please help
local creditsds = game:GetService("DataStoreService"):GetDataStore("Credits")
if creditsds:GetAsync("Credits_"..player.Name) then credits.Value = creditsds:GetAsync("Credits_"..player.Name) end
credits.Changed:connect(function(val) creditsds:SetAsync(credits.Value, val) end)
14:11:11.027 - Workspace.Main:88: attempt to index upvalue 'creditsds' (a nil value) |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 03 Aug 2014 05:37 PM |
| Is credits.Value changing? |
|
|
| Report Abuse |
|
|
Juddily
|
  |
| Joined: 24 Aug 2008 |
| Total Posts: 4243 |
|
| |
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 03 Aug 2014 05:39 PM |
^ Val is the value that changed, it is returned in the .Changed event.
@Games
which line is 88? |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2014 05:40 PM |
"Is credits.Value changing?"
it breaks on line 88 so no |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 03 Aug 2014 05:45 PM |
Can I see the entire script?
Also is it a script or localscript? |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2014 06:00 PM |
script in workspace
full script is a complete irrelevant gamescript
playeradded
game.Players.PlayerAdded:connect(function(player) player.TeamColor = BrickColor.new("Dark stone grey") local stats = Instance.new("IntValue", player) stats.Name = "leaderstats" local credits = Instance.new("IntValue", stats) credits.Name = "Credits" local win = Instance.new("BoolValue", player) win.Name = "Win" local alive = Instance.new("BoolValue", player) alive.Name = "Alive" for i, v in pairs(admins) do if string.lower(player.Name) == v then end end --[[repeat wait() until game.Players[player.Name]:FindFirstChild("Backpack") local tool = game.ReplicatedStorage.Tool:Clone() tool.Parent = game.Players[player.Name].Backpack ]] if creditStore:GetAsync(player.userId) ~= nil then credits.Value = creditStore:GetAsync(player.userId) else credits.Value = 0 end repeat wait() until player.Character local humanoid = player.Character.Humanoid
credits.Changed:connect(function(val) creditStore:SetAsync(player.userId,credit.Value) end)
humanoid.Died:connect(function() if round then player.Alive.Value = false print(player.Alive.Value) player.Win.Value = false end end)
end)
|
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 03 Aug 2014 06:04 PM |
| Uhh, where is the part you were originally asking about in the script? It looks like you replaced it with creditStore which you never set to be anything...? |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2014 06:05 PM |
yeah in another thread someone told me to do that
same error
pretend it didn't change |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 03 Aug 2014 06:13 PM |
| Use pcall on it and make a message if it errors then upload it to one of your places and test it. From my little amount of research I have found you have to use it on an uploaded place. |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2014 06:16 PM |
do i use pcall() or ypcall() i forget
also wouldnt a server be the same??? |
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 03 Aug 2014 06:20 PM |
I googled it and someone solved their similar problem just by doing it in a public game. I'm not 100% sure it would fix it but do you have a better idea? Might as well try it.
As for the pcall thing, just use pcall. |
|
|
| Report Abuse |
|
|
| |
|