I made a simple UI script that let’s you choose an overhead tag for your character, however, this only happens in the client and no one other than you is able to see it.
I thought switching from a LocalScript to a normal Script would solve it, but instead it breaks the whole thing; I’ve searched about it and found you need to use a RemoteEvent/RemoteFunction, the problem is, I don’t know how and have tried too many times without success
I’d appreciate if someone could teach me what I’m doing wrong…
This Script is located in ServerScriptService:
local ServerStorage = game:GetService("ServerStorage")
local Overhead = ServerStorage:WaitForChild("Overhead")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local Clone = Overhead:Clone()
Clone.Parent = character.Head
Clone.Label.Text = player.Name
end)
end)
This LocalScript is located inside StarterGui > ScreenGui > Frame > TextButton (inside each of the buttons) [I’d appreciate if someone can tell me if this is bad practice and if there’s another way around]:
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character
local Button = script.Parent
local DisplayText = script.Parent.Text
local TXT_COLOR = script.Parent.BackgroundColor3
--\\===============================================//--
local function ButtonPress()
local TextLabel = Character.Head.Overhead.Label
TextLabel.Text = DisplayText
TextLabel.TextColor3 = TXT_COLOR
TextLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
TextLabel.TextStrokeTransparency = 0.25
end
Button.Activated:Connect(ButtonPress)