Closed this post is closed

Hello, I am creating a Overhead GUI, but I want to make it so that people own a gamepass they get a rainbow overhead, and if the player is a certain rank they get a rainbow overhead, such as
Player owns VIP Gamepass = Rainbow Overhead
Vice-Chairman+ = Overhead. I am not much of a scripter so bare with me.

1 Like

This is the code I have already:
groupid = 6267215

game.Players.PlayerAdded:connect(onPlayerRespawned)
function onPlayerRespawned(newPlayer)
	wait(0.5)
		local gui = script.Rank:clone()
		gui.Parent=newPlayer.Character.Head
		gui.Adornee=newPlayer.Character.Head
		local texta=gui.Frame.TextLabel
		texta.Text = (newPlayer:GetRoleInGroup(groupid))
		local textb=gui.Frame.Name1
		textb.Text = newPlayer.Name
		textb.TextColor3 = Color3.new(255,255,255)
		textb.TextStrokeColor3 = Color3.new(255,255,255)
		wait(1)
if texta.Text == "Visitor" then
	texta.Text = "Visitor"
end
end


function onPlayerEntered(newPlayer)
	newPlayer.Changed:connect(function (property)
		if (property == "Character") then
			onPlayerRespawned(newPlayer)
		end
	end)
end

game.Players.PlayerAdded:connect(onPlayerEntered)

You can use this feature:

MarketPlace = game:GetService("MarketplaceService")

MarketPlace:UserOwnsGamepassAsync(GamepassID, player.UserId)

If you pair it with a if-statement you can execute specific code.

2 Likes

I have no idea how to use that.

Off topic: I was reading trough scripting Helpers and found someone with mostly the same problem; They wanted a Rainbow Overhead when a player is a certain rank

It’s a very simple concept that is required for the basics of scripting, if you don’t know how to use it, I suggest you going through youtube tutorials online or liking at the wiki for help in-order to advance your scripting.

1 Like