Hello Robloxians! Recently I decided to make a new game but I stumbeled upon a problem. I made police team and here is the problem not all ranks have the same the same clothing soo if anyone knows how to make a script that gives You shirt,pants and t-shirt by their rank please help me.
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
I’m on phone right now so I probably can’t assist you as much as you wish but couldn’t you just check the Players Team and then change the Shirt ID dependant on what team?
I am not a scripter only thing I done was make for each rank a uniform but that was to messy and people that are not that rabks would be taking higher ranks uniforms.
Here I understand scripting from scratch can be a little hard so I’m going to give you a little guide:
game:GetService("Players").PlayerAdded:Connect(function(plr)
if plr:GetRankInGroup(GROUPID) >= 255 then
-- SHIRT & PANTS STUFF HERE
elseif plr:GetRankInGroup(GROUPID) == 45 then
-- SHIRT & PANTS STUFF HERE
elseif (plr:GetRankInGroup(GROUPID) == 45) and (plr.TeamColor == "Black") then
-- SHIRT PANTS STUFF HERE
end
end)
This code gets the service “Players”, so think of that all the players. It then waits for a new player to join the game.
It then creates a function with the parameter of the player that joined. (plr)
if plr:GetRankInGroup(GROUPID) >= 255 then
This line sees if the player is in “GROUPID” and is greater than or equal to 255 (the owner).
If this is valid then it does whatever you want it to do.
The line after is just the same example but for RANKID 45
elseif (plr:GetRankInGroup(GROUPID) == 45) and (plr.TeamColor == "Black") then
This line sees if the player is in the group (rank 45) and is on the teamcolor of “Black”
Obviously this wont necessarily work on join as you’d need to team them before it sees their rank.
But if you have a morph/uniform giver then this will be useful to make sure they’re on the correct team and correct rank to get their uniform.
I recommend this tutorial online for changing the shirt/pants: