|
| 31 Mar 2014 01:22 PM |
Is there something wrong with my tables or what?
DS = game:GetService("DataStoreService"):GetDataStore("Rep")
Ranks = {"Devil", "Bandit", "Tango", "Civilian", "Friendly", "Hero", "Savior"}
Colors = { Color3.new(1, 1, 0), Color3.new(0, 0, 0), Color3.new(1, 0, 0), Color3.new(1, 1, 1), Color3.new(0, 85/255, 0), Color3.new(0, 85/255, 1), Color3.new(0, 0, 127/255) }
game.Players.PlayerAdded:connect(function(p) repeat local b = p:FindFirstChild("Backpack") until b repeat local g = p:FindFirstChild("PlayerGui") until g repeat local h = c:FindFirstChild("Humanoid") until h repeat local t = c:FindFirstChild("Torso") until t repeat local ra = c:FindFirstChild("Right Arm") until ra repeat local la = c:FindFirstChild("Left Arm") until la repeat local rl = c:FindFirstChild("Right Leg") until rl repeat local ll = c:FindFirstChild("Left Leg") until ra local Key = "user_" .. p.userId DS:UpdateAsync(Key, function(OldRep) Rep = OldRep or 0 return Rep end) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) --MAKES LEADERBOARD HERE (DOES NOT REACH THIS POINT) local l = Instance.new("Model", p) l.Name = "leaderstats" local r = Instance.new("IntValue", l) r.Name = "Rep" r.Value = Rep local rank = Instance.new("StringValue", p) rank.Name = "Rank" if Rep < -300 then --Devil -300 and lower rank.Value = Ranks[1] local ranknumber = 1 elseif Rep > -300 and Rep < -99 then --Bandit -100 to -299 rank.Value = Ranks[2] local ranknumber = 2 elseif Rep > -100 and Rep < 49 then --Tango -50 to -99 rank.Value = Ranks[3] local ranknumber = 3 elseif Rep == 0 then --Cvilian --0 rank.Value = Ranks[4] local ranknumber = 4 elseif Rep > 49 and Rep < 100 then --Friendly 50 to 100 rank.Value = Ranks[5] local ranknumber = 5 elseif Rep > 99 and Rep < 300 then --Hero 100 to 300 rank.Value = Ranks[6] local ranknumber = 6 elseif Rep > 299 then rank.Value = Ranks[7] local ranknumber = 7 end local s = script:FindFirstChild("AutoUpdation Rep"):Clone() s.Parent = p.Backpack s.Disabled = false local gui = script.RepGui:Clone() gui.Parent = game.Lighting gui.Frame.Rep.Text = "REP: ".. p.leaderstats.Rep.Value .."" gui.Frame.Rank.Text = "RANK: ".. p.rank.Value .."" gui.Frame.Rank.TextColor3 = Colors[ranknumber] gui.Frame.Name.Text = "".. p.Name .."" gui.Frame.Picture.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&username=".. p.Name .."" gui.Name = p.Name local CD = Instance.new("ClickDetector", t) local cs = script.ClickScript:Clone() cs.Parent = CD cs.Disabled = false end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 31 Mar 2014 01:49 PM |
game.Players.PlayerAdded:connect(function(p)
Arguments... |
|
|
| Report Abuse |
|
|
GFXdylan
|
  |
| Joined: 09 Feb 2013 |
| Total Posts: 679 |
|
| |
|
|
| 31 Mar 2014 01:56 PM |
| Ya... I think you're confusing yourself with all the repeats, keep to one repeat block. |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2014 02:24 PM |
| The repeats shouldn't be a problem -_- |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2014 02:32 PM |
Well it's pretty messy, reminds me of this well written paper: https://www.thc.org/root/phun/unmaintain.html
|
|
|
| Report Abuse |
|
|
|
| 31 Mar 2014 02:44 PM |
"game.Players.PlayerAdded:connect(function(p)
Arguments..."
the p you're mentioning later in the script is outside the function scope.
#nerdsunited |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2014 02:46 PM |
@verified
It isn't he is using updateasync, the second argument is a function. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|