I made a script for the player to enter a team, but I get it by name in the text, but it gives me an error. Below:
Unable to assign property Team. Object expected, got string
game.ReplicatedStorage.ServerControllers.Job.OnServerEvent:Connect(function(p,team)
if team then
p.Team = team
p:LoadCharacter()
local teamChange = game.ReplicatedStorage.ServerControllers.Job
for i,v in pairs(mainjobs:GetChildren()) do
if v:IsA("Frame") then
warn("---")
v.Button.MouseButton1Click:Connect(function()
teamChange:FireServer(v.Title.Text)
end)
end
end