Character outline when gamepass is owned

Hi guys quick question can you say me how can I make it that when a player own a gamepass in my game that his skin have a red outline ?

1 Like

add an highlight to the player model

1 Like

Use a script that checks for gamepass owners. if they do have the game, give them the outline

1 Like

But it should only show when the player own a gamepass

1 Like

And why this script don’t work ?

local gamepassID = "GamepassID"

local function showHighlight(player)
  
    if game:GetService("GamePassService"):PlayerHasPass(player, gamepassID) then
       
        local highlight = Instance.new("SelectionBox")
        highlight.Color3 = Color3.new(1, 0, 0) -- Rote Farbe
        highlight.LineThickness = 0.1
        highlight.Adornee = player.Character
        highlight.Parent = player.Character
    end
end

game.Players.PlayerAdded:Connect(showHighlight)

-
for _, player in ipairs(game.Players:GetPlayers()) do
    showHighlight(player)
end
1 Like

The Roblox assistant have have me this I have created a script in explorer and paste this inside and changed the Gamepass id

1 Like

Where is the script located??

(Character Limit)

1 Like

A normal script in explorer There I have paste it

1 Like

ill look into it, ill try running the script in my studio.

2 Likes

can you send me the script that you have right now? with the changed gamepass id?

2 Likes

Wait I need to find it one sec please

1 Like

Alright, no problem. take your time

1 Like

Ty for helping me that’s very kind

2 Likes

1 Like

I think i found the problem. Test if it works.

change

if game:Get("ServiceGamePassService"):PlayerHasPass(player, gamepassID) then

to

if game:GetService("GamePassService"):PlayerHasPass(player, gamepassID) then

You put Service inside the string. Probably a misundersanding

Also; Do you have the game pass in the first place?

Edit: Nevermind, game owners get it automatically

2 Likes

And other question when I have you here how this thing work I don’t understand it ezVisualz - UIGradient and UIStroke effects made easy!

I don’t understand how to use this effect on a frame or text what ever

1 Like

it seems like it uses UIGradient. I dont work with GUI’s so i dont know alot about this, what i do know though is that UI Gradient can be used to obviously, add gradients (different colours)

1 Like

Ok np but I try out the script and it don’t work with the outline

1 Like

i dont really know how to work with SelectionBoxes myself :sweat_smile: ill try to find out more, and ill keep you notified

2 Likes

:PlayerHasPass is not correct. You should be using :UserOwnsGamePassAsync.

Code:

local Players = game:GetService("Players")
local MarketplaceService = game:GetService("MarketplaceService")

local gamepassID = "GamepassID"

local function onPlayerAdded(player)
	player.CharacterAdded:Connect(function(character)
		if MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamepassID) then
			local highlight = Instance.new("Highlight")
			highlight.DepthMode = Enum.HighlightDepthMode.Occluded
			highlight.FillTransparency = 1
			highlight.OutlineColor = Color3.new(1, 0, 0) -- Rote Farbe
			highlight.Parent = character
		end
	end)
end

Players.PlayerAdded:Connect(onPlayerAdded)

for _, player in Players:GetPlayers() do
	task.spawn(onPlayerAdded, player)
end
2 Likes