Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why are these lines either not running or running twice?

Asked by 4 years ago

I am making a tycoon game that saves your data. I have saved and loaded the data but now when someone claims their tycoon, the code that looks through what the player owns doesn't work very well.

line 37 is either not running or is being overrited by line 62

01for i, v in pairs(player.PurchaseFolder:GetChildren()) do
02                for i, t in pairs(script.Parent.Parent.Buttons:GetChildren()) do
03                    if v.Value == t.Name then
04                        for i, o in pairs(script.Parent.Parent.Buyable:GetChildren()) do
05                            local str = string.split(t.Name," ")
06                            local str2 = string.split(o.Name, " ")
07                            if str[2] ~= "|" then
08                                print("1")
09                                if str2[1] == str[1] and str2[2] == str[2] then
10                                    print(str[1]..", "..str2[1]..". "..str[2]..", "..str2[2])
11                                    print("2")
12                                    if str[1] == "Lights" and str[2] == str2[2] then
13                                        print("3")
14                                        for i, child in ipairs(o:GetChildren()) do
15                                            if child.ClassName == 'Model' then
View all 84 lines...

1 answer

Log in to vote
0
Answered by 4 years ago

I think you should be using datastores for this saving function?

Ad

Answer this question