Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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

0
So what is the problem? User#20388 0 — 6y
0
It just wont work. ChiefNight 9 — 6y
0
I dont see any issues in client logs etc, and the decal will not change ChiefNight 9 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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
0
If that's not it, please tell me. DeceptiveCaster 3761 — 6y
0
It works. Thank you, ChiefNight 9 — 6y
Ad

Answer this question