I have a script that when fires it takes the local players team and attempts to concatenate it to a string. I say attempts because when i actually test it it returns nil value. How can i avoid this?
Server script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Teams = game:GetService("Teams")
local remoteEvent = ReplicatedStorage:WaitForChild("Mobilization")
local function onCreatePart(player)
local cities = workspace:FindFirstMatching({
Name = player .. "_cities"; --doesnt work
IsA = "Model";
})
print(cities.Name);
end
remoteEvent.OnServerEvent:Connect(onCreatePart)
Localscript on gui button click:
local Players = game:GetService("Players")
local Teams = game:GetService("Teams")
local player = game.Players.LocalPlayer.Team; --It should concatenate with this
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:WaitForChild("Mobilization")
script.Parent.MouseButton1Click:Connect(remoteEvent:FireServer(player))
print(player);

2 comments
Why do you have the semicolons?
i am transitioning from c++, so its a habit