I have a script that gives a user a tool if they’ve been assigned as a staff, I have another script that when a player joins, it checks if they’ve been assigned as staff and if they have, it gives them the staff card tool. However, it doesn’t give them the tool.
Code:
game.Players.PlayerAdded:Connect(function(player)
if game.ServerStorage.Staff:FindFirstChild(tostring(player.UserId)) then
local staffCard = game.ServerStorage.StaffCard:Clone()
staffCard.Handle.SurfaceGui.Frame:WaitForChild("Owner").Text = "Owned by: "..player.Name
staffCard.Handle.SurfaceGui.Frame:WaitForChild("Role").Text = "Role: "..game.ServerStorage.Staff[tostring(player.UserId)].Value
staffCard.Parent = player.Backpack
end
end)
Oh, that’s to check if the user was assigned. In my assigning script, I make it so it creates a StringValue inside a folder called Staff inside the ServerStorage. I name the StringValue with the person’s user ID.
That just checks if a StringValue with the name of the player’s UserID exists.
Yes I am. This is a PlayerAdded event. I also put a print(“”) and it printed it out meaning the if condition is true. The only part not working is the giving tool.
What I’m thinking is that it’s because the character hasn’t loaded in?