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: Made a rep system. Can't find the error.

Previous Thread :: Next Thread 
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
27 Mar 2014 04:06 PM
Main script:

DS = game:GetService("DataStoreService"):GetDataStore("Rep")

Ranks = {"Devil", "Bandit", "Tango", "Civilian", "Friendly", "Hero", "Savior"}

Colors = {
Yellow = "255/255, 255/255, 0",
Black = "0, 0, 0",
Red = "255/255, 0, 0",
White = "255/255, 255/255, 255/255",
Green = "0, 85/255, 0",
LBlue = "0, 85/255, 255/255",
DBlue = "0, 0, 127/255"
}

game.Players.PlayerAdded:connect(function(p)
repeat
local p = p
until 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)
local Rep = OldRep or 0
end)
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 = Color3.new(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)


ClickScript: (child of the main script)

repeat
local p = p
until 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 CD = script.Parent
local Torso = CD.Parent
local Player = Torso.Parent
local Lighting = game.Lighting:GetChildren()
CD.MouseClick:connect(function(p)
for i = 1,#Lighting do
if Lighting[i].Name == Player.Name then
RepGui = Lighting[i]:Clone()
Lighting[i].Parent = p.PlayerGui
end
end
end)


AutoUpdation Rep: (Another child of main script)

repeat
local p = p
until 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
repeat
wait(1)
Player = game.Players.LocalPlayer
Rank = Player.Rank
if Rep < -300 then --Devil -300 and lower
rank.Value = Ranks[1]
elseif Rep > -300 and Rep < -99 then --Bandit -100 to -299
rank.Value = Ranks[2]
elseif Rep > -100 and Rep < 49 then --Tango -50 to -99
rank.Value = Ranks[3]
elseif Rep == 0 then --Cvilian --0
rank.Value = Ranks[4]
elseif Rep > 49 and Rep < 100 then --Friendly --50 to 100
rank.Value = Ranks[5]
elseif Rep > 99 and Rep < 300 then --Hero --100 to 300
rank.Value = Ranks[6]
elseif Rep > 299 then
rank.Value = Ranks[7]
end
until Player == nil


There is also a gui called RepGui, it is a child of the main script. Please help!
Report Abuse
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
27 Mar 2014 04:15 PM
http://www.roblox.com/Forum/ShowPost.aspx?PostID=80625843

I quote from that post of rules :
"Suggestion:
Don't ask others to debug your broken code without giving a hint what sort of problem you are having. Posting a few hundred lines of code, saying "it doesn't work", will get you ignored. Posting a dozen lines of code, saying "after line 7 I was expecting to see (something), but (something else) happened instead" is much more likely to get you a reply."
Report Abuse
TheGamer101 is not online. TheGamer101
Joined: 14 Feb 2009
Total Posts: 11943
27 Mar 2014 04:19 PM
"repeat
local p = p
until p"

Not sure what you are trying to do here. And surely it should have a wait?
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
27 Mar 2014 04:21 PM
Yeah, that's strange.
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
27 Mar 2014 04:24 PM
I'm sorry, though. What is a rep system?
Report Abuse
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
27 Mar 2014 04:25 PM
Why is he defining p as p?
Report Abuse
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
27 Mar 2014 04:26 PM
Oh the argument is p but defining p as p will crash... won't it?
Report Abuse
TheGamer101 is not online. TheGamer101
Joined: 14 Feb 2009
Total Posts: 11943
27 Mar 2014 04:26 PM
Your method for getting the Color3s will not work. For example :

print(Color3.new("255/255, 255/255, 0"))
>0, 0, 0
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
27 Mar 2014 04:27 PM
Instead of "Repeat" just put wait(1) at the beginning of that and you should be fine.
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
27 Mar 2014 04:28 PM
Color3.new(255/255,255/255,0)
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
27 Mar 2014 04:35 PM
Which script is erroring, and how can I fix it?
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
27 Mar 2014 04:37 PM
Oh the rep system is a Reputation System. The scripts don't work. At. All. SO there wasn't much info I could put it. Sorry
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
27 Mar 2014 06:29 PM
I thought the colouring was a problem.. How do I fix it?


Sorry about earlier, I was in a rush.
Report Abuse
devLucas is not online. devLucas
Joined: 10 Dec 2013
Total Posts: 526
27 Mar 2014 06:32 PM
Colors = {
Yellow = (1, 1, 0),
Black = (0, 0, 0),
Red = (1, 0, 0),
White = (1, 1, 1),
Green = (0, 85/255, 0),
LBlue = 0, 85/255, 1),
DBlue = (0, 0, 127/255)
}
Report Abuse
devLucas is not online. devLucas
Joined: 10 Dec 2013
Total Posts: 526
27 Mar 2014 06:34 PM
Oops forgot a parentheses

Colors = {
Yellow = (1, 1, 0),
Black = (0, 0, 0),
Red = (1, 0, 0),
White = (1, 1, 1),
Green = (0, 85/255, 0),
LBlue = (0, 85/255, 1),
DBlue = (0, 0, 127/255)
}
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
28 Mar 2014 05:00 PM
Error


Line Code
5 Colors = {
6 Yellow = {1, 1, 0}
7 Black = {0, 0, 0} --Error Here
8 Red = {1, 0, 0}
9 White = {1, 1, 1}
10 Green = {0, 85/255, 0}
11 Lblue = {0, 85/255, 1}
12 DBlue = {0, 0, 127/255}
13 }


Error; '}' expected (to close '{' at line 5) near 'Black'
Report Abuse
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
28 Mar 2014 05:04 PM
Warspy your using square brackets for all the colours... only for the table which defines the colours should have square brackets example :
Pies = {TABLE IN HERE}
You putting a "{" and a "}" around every colour
Report Abuse
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
28 Mar 2014 05:06 PM
Colors = {
Yellow = (1, 1, 0),
Black = (0, 0, 0),
Red = (1, 0, 0),
White = (1, 1, 1),
Green = (0, 85/255, 0),
LBlue = (0, 85/255, 1),
DBlue = (0, 0, 127/255)
}

And your doing :

Colors = {
Yellow = {1, 1, 0},
Black = {0, 0, 0},
Red = {1, 0, 0},
White = {1, 1, 1},
Green = {0, 85/255, 0},
LBlue = {0, 85/255, 1},
DBlue = {0, 0, 127/255}
}
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
28 Mar 2014 05:09 PM
Colors = {
Yellow = (1, 1, 0),
Black = (0, 0, 0),
Red = (1, 0, 0),
White = (1, 1, 1),
Green = (0, 85/255, 0),
LBlue = (0, 85/255, 1),
DBlue = (0, 0, 127/255)
}


Thanks, but now I am getting a new error at Yellow;

')' expected near ','

Help?
Report Abuse
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
28 Mar 2014 05:12 PM
Ohhh i see why it is happening at yellow. Say yellow isn't there right? Black would then error. So its the structure of that block which is bad. It wont accept the use of commas in that way :/ I dont know what to do???
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
28 Mar 2014 05:19 PM
so... Now what?
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
28 Mar 2014 05:20 PM
This is crucial to my rep system! Dimension (My primary group) needs this!
Report Abuse
TheGamer101 is not online. TheGamer101
Joined: 14 Feb 2009
Total Posts: 11943
28 Mar 2014 05:23 PM
Yellow = Color3.new(1, 1, 0)
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
28 Mar 2014 07:15 PM
So instead of Black = (0, 0, 0),

It is

Black = Color3.new(0, 0, 0),


???
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
28 Mar 2014 07:18 PM
Yes.


Btw, you know you can use WaitForChild for a good chunk of this script.
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