Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to make a billboard gui appear on all players but yourself?

Asked by 3 years ago
Edited 3 years ago

Recently I have been trying to make a billboard gui appear on all the players in the game but yourself to make it so the players can simply click on the player they want to mute. Because the billboard gui has buttons on, it needs to be in the PlayerGui, therefore I need to adornee a different billboard gui to all the players UpperTorso’s.

I have tried many different approaches to this, such as remote events, and looping through all the players in a local script to asign the billboard gui to the different players. However whenever I test it there are always a few players without anything asigned to them.

The closest I have got to this working was with a remote event. When testing with 8 players in studio, 2/8 players had no issues but the other 6 clients had 1 player without a billboard gui asigned to them, instead the gui that was supposed to be on the player was located in the middle of the baseplate. Here is an example image: https://doy2mn9upadnk.cloudfront.net/uploads/default/optimized/4X/9/a/3/9a3f289f1441c43d6a06354171ee7a2a378fb819_2_626x500.jpeg

this is the code I used: (Server Script)

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local individualMute = ReplicatedStorage:WaitForChild("individualMute")

local function onPlayerAdded(player)
    individualMute:FireAllClients(player)
end

Players.PlayerAdded:Connect(onPlayerAdded)

(Local Script)

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local playerGui = player.PlayerGui
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local individualMute = ReplicatedStorage:WaitForChild("individualMute")
local muteGui = ReplicatedStorage:WaitForChild("muteGui")
local muteGuiFolder = playerGui:WaitForChild("individualMute")


local function onInduvidualMute()
    for i, otherPlayers in pairs(Players:GetChildren()) do
        if otherPlayers ~= player then
            local muteGuiClone = muteGui:Clone()
            muteGuiClone.Name = otherPlayers.Name
            muteGuiClone.Frame.Visible = true
            muteGuiClone.Parent = muteGuiFolder
            local character = otherPlayers.Character
            if not character or not character.Parent then
                character = player.CharacterAdded:wait()
            end
            muteGuiClone.Adornee = character.UpperTorso
        end
    end
end

individualMute.OnClientEvent:Connect(onInduvidualMute)
0
Any errors? deadwalker601 110 — 3y
0
no YT_GamingDan 10 — 3y

Answer this question