So if a player is close to a part(microphone) then It should show a message on what that player has typed, but I have no idea how to find out if the player is close to the mic. If you know what i mean xd
local mic = workspace.AnnouncerTable.MIC.Main
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(m)
if plr.Character.Head.Poisition == math.random(mic.Position<3) then
local screengui = Instance.new("ScreenGui")
local textlabel = Instance.new("TextLabel")
textlabel.Size = UDim2.new(1,0,1,0)
textlabel.Text = m:lower()
textlabel.BackgroundTransparency = 1
textlabel.TextScaled = true
end
end)
end)
Its line 5 I just tried giving it a go

3 comments
Duplicate of https://scriptinghelpers.org/questions/19833/how-can-i-detect-when-a-player-goes-near-to-a-part
bruh k
(plr.Character.Head.Poisition - npc.Head.Position).magnitude