Could anyone help me with this? The car spawns, despawns and drives fine but it doesnt spawn next to me, rather it spawns in some fixed position
local re = game:GetService("ReplicatedStorage"):WaitForChild("CarCheck")
re.OnServerEvent:Connect(function(plr, car)
local n = "Car-"..plr.Name
local c = game.Workspace:FindFirstChild(n)
if c then
c:Destroy()
end
local s = game:GetService("ReplicatedStorage").Cars:FindFirstChild(car)
if s then
local f = s:Clone()
f.Name = "Car-"..plr.Name
f.Parent = workspace
local l = plr.Character.HumanoidRootPart.Position
f.Position = l
elseif s == nil and car == "Ball" then
local s = game:GetService("ReplicatedStorage").Cars:FindFirstChild("Ball")
local f = s:Clone()
f.Name = "Car-"..plr.Name
f.Parent = workspace
local l = plr.Character.HumanoidRootPart.Position
f.Position = l
end
end)
** You are now Level 7! **