I know i answered this question before, but no one answered it (only one, but it didnt work) title explains everything. in studio, it works and i get no errors, but ingame i getgame.Workspace.spawner:8: attempt to local "c" (a nil value).
script:
game.ReplicatedStorage:WaitForChild("SpawnCar").OnServerEvent:Connect(function(player,c)
for i,v in pairs(game.Workspace:GetChildren()) do
if v.Name == player.Name.."'s Car" then
v:Destroy()
end
end
wait(0.1)
local car = c:Clone()
car:SetPrimaryPartCFrame(player.Character.HumanoidRootPart.CFrame + Vector3.new(0,0,15))
car.Parent = game.Workspace
car:MakeJoints()
car.Name = player.Name.."'s Car"
end)
script that fires it:
script.Parent.MouseButton1Click:Connect(function()
game.ReplicatedStorage.SpawnCar:FireServer(game.Players.LocalPlayer:WaitForChild("SelectedCar").Value)
end)
thanks

2 comments
Question, what is "C" on your script anyways?
If you look in the view source part of the code you will be able to see everything that it contains