Character outline when gamepass is owned

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

And should I create a script in explorer or in server script service

It worked but only in studio when I got to Roblox and ply it the outline don’t shown

1 Like

I tested the script, it works for me. (put in ServerScriptService by the way).
Maybe you forgot to publish the game. Try clicking Alt + P in studio, then return to the game.

2 Likes

I try it one sec please I try it

1 Like

Don’t working I have this problem

Roblox studio :arrow_down:

In Game (iPad):arrow_down:

1 Like

Why is this so please help me guys

1 Like

See if there are any errors in the output window

1 Like

Try this:

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

local gamepassID = your game pass id here

local function showHighlight(player)
  
    if MarketplaceService:UserOwnsGamepassAsync(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, Player)

for _, player in Players:GetPlayers()) do
    showHighlight(player)
end
1 Like

This is an engine bug that has been going around for about a year now. Seems like a lot of other developers have this bug too. Highlights do not show on mobile devices

1 Like

And what can I do to solve this problem?

I’m not sure if there’s a fix to it. Unless if roblox fixes their game lmao

1 Like

I dot think theres a way to fix it, as its an engine bug. can the game be played for pc aswell? if so, i dont think it would be much of a problem.

1 Like

It only effects mobile/tablet devices

1 Like

Yeah i know that. Im just wondering if its Mobile device only. Cause if PC player have access, i dont see this as a big problem.

2 Likes

I’ll just use SelectionBoxes then.

Code:

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

local gamepassID = "GamepassID"

local function addSelectionBoxes(character)
	for i, child in character:GetChildren() do
		if child:IsA("BasePart") then
			local selectionBox = Instance.new("SelectionBox")
			selectionBox.Color3 = Color3.new(1, 0, 0) -- Rote Farbe
			selectionBox.LineThickness = 0.05
			selectionBox.Adornee = child
			selectionBox.Parent = child
		end
	end
end

local function onPlayerAdded(player)
	player.CharacterAdded:Connect(function(character)
		if MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamepassID) then
			addSelectionBoxes(character)
		end
	end)
end

Players.PlayerAdded:Connect(onPlayerAdded)

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

iPads can’t show highlights. No one knows why but its been on the bug list for over a year now. As proven in Highlights do not show on mobile devices