#Badge Equips Chat Tag System Only working on Client

1 messages · Page 1 of 1 (latest)

ashen nest
#

I have a UI button that opens a menu that shows all the badges and if you own one well you can equip it, if you equip it then your chat tag shows up in the chat. So I was wondering if it only shows the chat tag for the client or if all players can see it, if it only shows for the client how could I make it show for all players? (also idk why text color for player is white when badge tag equipping)

#

going to school rn so wont respond until im back

spice pike
inner ginkgo
#

Modulescript

ashen nest
#

can someone fix it for me

#

i have no brain

spice pike
spice pike
ashen nest
spice pike
#

yes

ashen nest
#

also that makes no sense cause all the ui is built from that local script that goes into starterplayerscripts so would it still build the ui?

lost rivetBOT
#

studio** You are now Level 1! **studio

ashen nest
spice pike
#

so

#

basically

#

here

#

lemme draw some boxes

#

you still use a localscript

#

just all the logic is in the module

#

so you get both the tags appearing for everyone and the local ui

ashen nest
#

im stupid

ashen nest
# spice pike

so I make a module script? and add the local script as a child to it?

#

what do i put in the module script, and do i put that in serverscriptservice?

spice pike
#

no

#

keep the local script where it is

ashen nest
#

yeah

spice pike
#

okay

#

now add a modulescript to serverscriptservice

ashen nest
#

alright

#

now whats in the module script

spice pike
#

add a remote event to replicated storage too

lost rivetBOT
#

studio** You are now Level 5! **studio

spice pike
#

don't forget that

ashen nest
#

what do i call it

spice pike
#

uh EquipBadgeEvent

#

name the module BadgeManager or something

ashen nest
#

alright

#

and in the local script i shared earlyer?

spice pike
#

name doesn't matter for that just name it whatever

ashen nest
#

okay tell me the instructions ill be home in 3 hours or 2 idk

spice pike
#

okay

#

basically for the modulescript, you do something like this

local Players = game:GetService("Players") -- duh

local EquipBadgeEvent = ReplicatedStorage:WaitForChild("EquipBadgeEvent") -- whatever you named the remote

local equippedBadges = {} -- table to track equipped badges

EquipBadgeEvent.OnServerEvent:Connect(function(player, badgeId) -- simple function to equip the badge duh
    equippedBadges[player.UserId] = badgeId -- this is optional but you should add it
    player:SetAttribute("EquippedBadge", badgeId) -- equips the badge
end)

Players.PlayerRemoving:Connect(function(player) -- when the player is removed, set the equipped badges to nil if you want to
    equippedBadges[player.UserId] = nil
end)```
#

and your localscript will be something like this

ashen nest
#

is the local script and module script gonna work together

#

nvm

spice pike
spice pike
#

then add whatever your ui logic was

ashen nest
#

so i could just ai to merge that locla script and my ui script?

spice pike
#

📜Join my Discord Community if you want scripting help, give feedback, or just hang out:
https://discord.gg/WC6kPu5W5P

🔴Watch My Full Roblox ADVANCED Scripting Tutorial Series:
https://www.youtube.com/playlist?list=PLQ1Qd31Hmi3WKkVHnadvhOOjz04AuMYAf

🎨Watch My Full Roblox GUI Tutorial Series:
https://www.youtube.com/playlist?list=PLQ1Qd...

▶ Play video

Learn how to use module scripts on Roblox Studio with this Roblox scripting tutorial. Module Scripts allow you to call functions from different scripts and organise your code. I also go over the _G variable and why you should not use it.

Beginner Scripting Series: https://www.youtube.com/watch?v=BfLUt3mfJiY&list=PLsbxI7NIoTth8CE_os8sog72YTMLPhD...

▶ Play video
spice pike
#

nobody gonna stop you

ashen nest
#

alr ill try when i get home ty

lost rivetBOT
#

studio** You are now Level 2! **studio

spice pike
#

yup go crazy chat

ashen nest
#

aight

ashen nest
#

module script is that

#

thats badge system in starterplayerscripts

#

and i have a remote event called BadgeRemote

#

no idea why it doesnt work

ashen nest
spice pike
#

uh

#

im here now

#

do you have a video

ashen nest
#

?

#

uh ok ill send

ashen nest
spice pike
#

if it would load 😞

ashen nest
#

idk what that means

ashen nest
spice pike
#

press ctrl + shift + F

#

and type in "OnIncomingMessage"

#

and it should be in your modulescript

ashen nest
#

yep

ashen nest
spice pike
ashen nest
#

yeah and now what

ashen nest
lost rivetBOT
#

studio** You are now Level 3! **studio

spice pike
#

only works in localscripts

#

but its in your modulescript

ashen nest
spice pike
#

put it in your local lol

ashen nest
ashen nest
spice pike
#

the whole logic

ashen nest
#

so i just copy and paste module script into local?

ashen nest
spice pike
#

bros asking me like i know

ashen nest
#

😭

ashen nest
spice pike
#

@inner ginkgo yo you understand ts?