Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can I have help with this decal changing script based on ranks in a group?

Hi there, im having issues with a script that changes a decal with the players group. So if your for example number "6" in the group, it will change the decal to a specific texture. ( I have already removed the 1's etc)

groupId = 4068954
player = game.Players.LocalPlayer

if player:GetRankInGroup(groupId) == 255 then --CC
script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=1532554634"
	
	elseif player:GetRankInGroup(groupId) == 12 then --DCC
script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=1532554395"

	elseif player:GetRankInGroup(groupId) == 11 then --ACC
script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=1532554281"

	elseif player:GetRankInGroup(groupId) == 10 then --CS
script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=1532553963"
	
	elseif player:GetRankInGroup(groupId) == 9 then --SU
script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=1532553851"

	elseif player:GetRankInGroup(groupId) == 8 then --CINS
script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=1532553648"

	elseif player:GetRankInGroup(groupId) == 7 then --INS
script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=1532553514"

 	elseif player:GetRankInGroup(groupId) == 6 then --SGT
script.Parent.Decal.Texture = "http://www.roblox.com/asset/?id=1532553362"
end

Much appreciation for any help given. -ChiefNight

3 comments

0

So what is the problem?

0

It just wont work.

0

I dont see any issues in client logs etc, and the decal will not change

1 answer

✓ Accepted answer

I think I understand your problem: You're supposed to use rbxassetid when using IDs for audio instances, meshes and/or decals. Also, "GetRankInGroup" is not a valid method of the Player, and you'll have to use GroupService. The modified script:

groupId = 4068954
groupinfo = game:GetService("GroupService")
groupinfo2 = groupinfo:GetGroupInfoAsync(groupId)
-- Rest of the code here

2 comments

0

If that's not it, please tell me.

0

It works. Thank you,

This discussion is preserved as it was. New answers, comments, and votes are closed.