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.
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.
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.
-- 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