How to create BillboardGui only for client

  • I try to make a placemarker of parking.

  • I’m written script for placemarker, but it don’t work!

  • I’m watched help in Developer Hub and Youtube.

It’s a script of system:

local player = game.Players.LocalPlayer
local parkingBuyed = player.ParkingBuyed
local parking = player.Parking

parkingBuyed.Changed:Connect(function()
	if parkingBuyed.Value == true then
		script.Parent.ParkingMarker.Adornee = parking.Value.PrimaryPart
	end
end)

I put BillboardGui and local script to StarterGui.
Снимок

1 Like

Thats a frame?, i think its because you need to have it in a screengui

No. Placemarker must be visible in workspace by client (player).

Im sorry but i dont really understand that symbols, can you explain me what you have?

Is there any error in the output? I have a hunch the script might error because you have 2 instances called “ParkingMarker” (one is a localscript, other is a GUI instance). The script could possibly find the LocalScript ParkingMarker, try to find Adornee but fail to do so since it’s not a GUI instance, and as a result it errors.

nvm

without more information about the specific issue youre facing or the desired functionality of the script, its difficult to pinpoint the exact problem. However, I can provide some general guidance and suggestions.

I can’t say, player have value “Parking”. When he buy it, this value is equals random parking without owner. In script written: if player buyed parking, then placemarker become visible for him on place, where parking.

In the output error “attempt to index nil with ‘PrimaryPart’”.

Seems like “Parking” value is nil, probably? Have you tried checking if the value changed after ParkingBuyed is set to true?

I check. Value is not a nil. Value is object.

Is the object a model? If it is, check if the model has a PrimaryPart set.

Yes, it’s model and it has primary part.

Can you take a screenshot of the model in Explorer and its properties aswell?

Sorry, only tomorrow. I will reply.

Use my script for reference

-- this is a server script within a part..

local players = game:GetService("Players")

local billboard = script.Parent.BillboardGui
local list = {"Username"}

local function isPlayerAllowed(player)
	for _, name in pairs(list) do
		if player.Name == name then
			return true
		end
	end
	return false
end

local function updateBillboard(player)
	if isPlayerAllowed(player) then
		billboard.Enabled = true
	else
		billboard.Enabled = false
	end
end

players.PlayerAdded:Connect(updateBillboard)
players.PlayerRemoving:Connect(updateBillboard)

for _, player in pairs(players) do
	updateBillboard(player)
end

Oh, I’m sorry for disturbing you. I found a way to fix it. All you had to do was use RemoteEvent. But I still thank all the helpers!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.