Personal card ID with surface GUI having a problem

Hello, I’m trying to make a card tool, Which you start with when you join.
But there is a problem making in replicate between the client and the server.

I’m trying to make the card say the player ID, Name, Team Name, and age, But I only got two results:

  1. Everyone is seeing their own info and everyone else is seeing at their card nil (Because using LocalScript)

  2. Everyone’s card is showing one player’s info

I would really appreciate it if someone could help me.

Ty!

I do not think there is a need to make anything local. Just make the script get the data from the specific user and give it to him. Everyone will be able to see it, and no card will have nil as information.

If you need help with the script you could send it too.

I tried everything, Every server script that can be

game.Players.PlayerAdded:Connect(function(plr)
print(script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Name)
if plr == script.Parent.Parent.Parent.Parent.Parent.Parent.Parent then
script.Parent.Text = plr.Name
end
end)

I have an idea then. Just put the card in StarterPack and put a normal script inside of it. Then, connect a function that activates when the tool is equipped, that will get the player thanks to the character, and there, the info.

That’s what I have done :confused:
I don’t know what else to do

What else should I try?
Btw thank for trying to help!

No, what have you done its a function that activates when the player joins, not when the tool is equipped:

In this case the script is inside the tool, not inside the part thats inside the tool

script.Parent.Equipped:Connect(function()
local player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
if player then
script.Parent.Card.SurfaceGui.Text = player.Name
end
end

This script also covers if the card is dropped and other player grabs it.

He means a SurfaceGui, not a GUI in the PlayerGui.

Now everyone’s card is showing one player info

Make sure the script is inside the tool. Keep in mind im not using your script location

I literally removed my post before you even said that

Local or Server, it should work either way, just that you don’t need to use a PlayerAdded event as that’ll fire for every Player that joins the game depending on how much players there are

--LocalScript example inside the Tool
local Player = game.Players.LocalPlayer
local Tool = script.Parent

Tool.Equipped:Connect(function()
    Tool.Card.SurfaceGui.Text = Player.Name
end)

Yeah I know, I have done that, Also thank for reminding!

Is not that making everyone card be nil except the player’s card?

Oh, right, also make sure its not a localscript

LocalScripts can work if they’re parented inside Tools

Plus it’d only affect the client-side only

But I want it to replicate. :confused:

Yes i know that, what i mean is that the player will be able to see their card info, cool. But what about others cards? That player will see them as nil.

1 Like

Didn’t see the replication part whoops

Fair enough, a regular ServerScript should work

I wonder if he fixed it yet. I don’t think there is any issues