Car = game.Workspace["Nissan 240SX(Car)"] local Clone = Car:Clone() function OnTouched(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) then for _,Player in pairs(game.Players:GetPlayers()) do if Player:FindFirstChild("leaderstats") then if Player.leaderstats.Money.Value > 68000 then do Player.leaderstats.Money.Value = Player.leaderstats.Money.Value -68000 if game.Players:GetPlayerFromCharacter(script.Parent)then do Clone.Anchored = false Clone.Position = Vector3.new(-24, 9.2, -874) Clone.Parent = game.Workspace Clone.Anchored = true wait(2) Clone.Anchored = false end end end end end end end end script.Parent.Touched:connect(OnTouched)
What i'm trying to do is when you step on the button, it takes $68000 and spawns the car at its coordinates.
Mistake:
1) It doesn't spawn the copied car at its coordinates.
All help would be gladly appreciated. Thanks! (Please don't say just one word)
Edit:
Car = game.Workspace("Nissan 240SX(Car)") function OnTouched(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) then for _,Player in pairs(game.Players:GetPlayers()) do if Player:FindFirstChild("leaderstats") then if Player.leaderstats.Money.Value > 68000 then do Player.leaderstats.Money.Value = Player.leaderstats.Money.Value -68000 function CarRespawn(hit) if game.Players:GetPlayerFromCharacter(script.Parent)then Clone = Car:Clone() Clone.Anchored = false Clone:MoveTo(Vector3.new(-24, 9.2, -874)) Clone.Parent = game.Workspace Clone.Anchored = true wait (2) Clone.Anchored = false end end end end end end end end script.Parent.Touched:connect(CarRespawn) script.Parent.Touched:connect(OnTouched)
Models do not have a "Position" property. You will have to use Move to.
Clone:MoveTo(Vector3.new(-24, 9.2, -874))