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: Need a little help, Please?

Previous Thread :: Next Thread 
EpicComputerGenuis is not online. EpicComputerGenuis
Joined: 16 Mar 2012
Total Posts: 985
23 Feb 2013 04:54 PM
Hello, I am having a problem with the below script.

Could someone please help me figure out how to make it so that it determines the group in order? And only shows the highest ranked division?
So, Say...

HIGHEST
High Ranks
Rangers
Marines
RRC
LOWEST

Im in HR, And Marines... I want it to only say that I'm in HR's not marines, Because HR is the highest.

groupid=448102
groupid2=694155
groupid3=694150
groupid4=783205
groupname4="{[[High Rank]]}"
groupname3="[Marine]"
groupname2="[[Ranger]]"
groupname="(RRC)"



game.Players.ChildAdded:connect(function (child)
local label=Instance.new("StringValue",child) label.Name="Group"
local label2=Instance.new("StringValue",child) label2.Name="Rank"
local label3=Instance.new("StringValue",child) label3.Name="Group2"
local label4=Instance.new("StringValue",child) label4.Name="Group3"
local label5=Instance.new("StringValue",child) label5.Name="Group4"
if child:IsInGroup(groupid) then label.Value=groupname label2.Value=child:GetRoleInGroup(groupid)
else label.Value="Unknown" label2.Value = "Player"
end
if child:IsInGroup(groupid2) then label3.Value=groupname2
end
if child:IsInGroup(groupid3) then label4.Value=groupname3
end
if child:IsInGroup(groupid4) then label4.Value=groupname4
end


child.Chatted:connect(function(msg)
local v=Instance.new("StringValue")
v.Value=child.Group.Value.." "..child.Rank.Value.." "..child.Group2.Value.." "..child.Group3.Value..""..child.Group4.Value.." "..child.Name..": "..msg
local col=Instance.new("Color3Value",v)
col.Name="Color"
col.Value=child.TeamColor.Color
game.Debris:AddItem(v,3)
gui=game.StarterGui.ChatService.Chats
t1=gui.Text1
t2=gui.Text2
t3=gui.Text3
t4=gui.Text4
t5=gui.Text5
t6=gui.Text6
t1.TextColor3=t2.TextColor3
t1.Text=t2.Text
t2.TextColor3=t3.TextColor3
t2.Text=t3.Text
t3.TextColor3=t4.TextColor3
t3.Text=t4.Text
t4.TextColor3=t5.TextColor3
t4.Text=t5.Text
t5.TextColor3=t6.TextColor3
t5.Text=t6.Text
t6.TextColor3=col.Value
t6.Text=v.Value
v.Parent=script
end)
end)



{We only really appreciate people when they pass away.
Report Abuse
EpicComputerGenuis is not online. EpicComputerGenuis
Joined: 16 Mar 2012
Total Posts: 985
23 Feb 2013 05:08 PM
Bump... -.-


{We only really appreciate people when they pass away.
Report Abuse
EpicComputerGenuis is not online. EpicComputerGenuis
Joined: 16 Mar 2012
Total Posts: 985
23 Feb 2013 05:12 PM
How many times do I have to bump to get some help, Really?


{We only really appreciate people when they pass away.
Report Abuse
EpicComputerGenuis is not online. EpicComputerGenuis
Joined: 16 Mar 2012
Total Posts: 985
23 Feb 2013 05:25 PM
Guys, You alive out there?


{We only really appreciate people when they pass away.
Report Abuse
EpicComputerGenuis is not online. EpicComputerGenuis
Joined: 16 Mar 2012
Total Posts: 985
24 Feb 2013 07:37 AM
Last time im going to ask for help...


{We only really appreciate people when they pass away.
Report Abuse
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
24 Feb 2013 07:42 AM
This is a free model from girlsniper of Vortex Security.
Report Abuse
EpicComputerGenuis is not online. EpicComputerGenuis
Joined: 16 Mar 2012
Total Posts: 985
25 Feb 2013 12:13 PM
Yes.. It is.

Which I am using for education purposes to try and develop the script, Problem?
Report Abuse
Bloximity is not online. Bloximity
Joined: 27 Aug 2012
Total Posts: 9
25 Feb 2013 12:18 PM
Unless I read wrong, you want the script to know which group is the higher priority or rank?
Report Abuse
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
25 Feb 2013 12:36 PM
Here could be a problem;

else label.Value="Unknown" label2.Value = "Player"
end

That should be after all your other if's.
Report Abuse
EpicComputerGenuis is not online. EpicComputerGenuis
Joined: 16 Mar 2012
Total Posts: 985
01 Mar 2013 09:32 AM
Blox know what I'm talking about.


{We only really appreciate people when they pass away.
Report Abuse
einsteinK is not online. einsteinK
Joined: 22 May 2011
Total Posts: 1015
01 Mar 2013 09:44 AM

ranks = {"Highest","Lower","Lowest","..."}

local function check(r)
for k,v in pairs(ranks) do
if v:lower() == r:lower() then
return v,k
end
end
end

function getHighest(ids)
local r = {}
for k,id in pairs(ids) do
local role = player:GetRoleInGroup(id)
if role ~= "Guest" then
r[id] = role
end
end
local hr,hv,hk = 0
for k,v in pairs(r) do
local nv,nr = check(r)
if nr> hr then
hr,hv,hk = nr,v,k
end
end
end
return hk,hv
end

local GroupId, Rank = getHighest({1,2,3,4,5})
print(player.Name,"his highest rank is",Rank,"in groupid",GroupId)

-- Not tested but should work, quickly improvisised
Report Abuse
EpicComputerGenuis is not online. EpicComputerGenuis
Joined: 16 Mar 2012
Total Posts: 985
02 Mar 2013 01:43 PM
Eins, So basically that would work? Or do I need to add your bit to my script?


{We only really appreciate people when they pass away.
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