So i made a car spawner, that spawns a car if you click G. It works in studio. The car works, and the body doesnt fall apart, and i can drive it. But when i test it in game, the body falls apart, and i cant sit in the seat. The script is placed in the playergui/startergui. Can somebody help me? thanks!
script:
local uis = game:GetService("UserInputService") local plr = game.Players.LocalPlayer local name = plr.Name..("'s Car") local debounce = false uis.InputBegan:connect(function(key) if key.KeyCode == Enum.KeyCode.G then for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren())do if v:IsA("Model") and v.Name == name then v:Destroy() end end end end) uis.InputEnded:connect(function(aey) wait() if aey.KeyCode == Enum.KeyCode.G then local car = plr.SelectedCar.Value:Clone() car.Parent = game.Players.LocalPlayer.Character car.Chassis.Base.Anchored = true car.Name = plr.Name..("'s Car") car:SetPrimaryPartCFrame(plr.Character.Head.CFrame * CFrame.new(0,0,-10)) car:MakeJoints() wait(1) car.Chassis.Base.Anchored = false end end)