I’m trying to make a script that assigns a value to a person which will be their role but outside of the tool it doesn’t work and when in the tool it may assign the same role multiple times
local players = game:GetService(“Players”)
local player = players.LocalPlayer
local Math = math.random(1,6)
local Role = player.Character:FindFirstChild(“Role”)
local card = player.Character.Card or game.Workspace.Card
this is a localscript, so it won’t be seen by other players. You need to create a serverscript to add roles, so I suggest you to fire an event from client only and do all role-giving thing on the server.
“it may assign the same role multiple times”
you should check if the given role has been given / the given player has a role already. You need to clean-up roles/players accordignly (I don’t know what it your aim, this is why I can’t add an exact “how to” way)