TZH on Nostr: local carModel = game.Workspace.CarModel -- Replace with the name of your car model ...
local carModel = game.Workspace.CarModel -- Replace with the name of your car model
local seat = carModel.Seat -- Replace with the name of your car's seat
game.Players.PlayerAdded:Connect(function(player)
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
-- Wait for the player to be loaded into the game
humanoid.Died:Wait()
-- Respawn the player when they die
player:LoadCharacter()
end)
-- Wait for the car and seat to be loaded in the game
carModel:WaitForChild("Seat")
-- Clone the seat for each player who joins the game
game.Players.PlayerAdded:Connect(function(player)
local newSeat = seat:Clone()
newSeat.Parent = carModel
newSeat.Disabled = false
player.CharacterAdded:Connect(function(character)
-- Move the player to the car's seat
local humanoid = character:WaitForChild("Humanoid")
humanoid.SeatPart = newSeat
end)
end)
Published at
2023-02-14 07:07:30Event JSON
{
"id": "32654a1b503c88059e92870d65db547be0a5d3acf6854a03ddab730150c3fff5",
"pubkey": "cc7a67745452c600257b3214c78d559d5ef671a9b274827c4bd9ebd7538b8f51",
"created_at": 1676358450,
"kind": 1,
"tags": [],
"content": "local carModel = game.Workspace.CarModel -- Replace with the name of your car model\nlocal seat = carModel.Seat -- Replace with the name of your car's seat\n\ngame.Players.PlayerAdded:Connect(function(player)\n local character = player.Character or player.CharacterAdded:Wait()\n local humanoid = character:WaitForChild(\"Humanoid\")\n \n -- Wait for the player to be loaded into the game\n humanoid.Died:Wait()\n \n -- Respawn the player when they die\n player:LoadCharacter()\nend)\n\n-- Wait for the car and seat to be loaded in the game\ncarModel:WaitForChild(\"Seat\")\n\n-- Clone the seat for each player who joins the game\ngame.Players.PlayerAdded:Connect(function(player)\n local newSeat = seat:Clone()\n newSeat.Parent = carModel\n newSeat.Disabled = false\n \n player.CharacterAdded:Connect(function(character)\n -- Move the player to the car's seat\n local humanoid = character:WaitForChild(\"Humanoid\")\n humanoid.SeatPart = newSeat\n end)\nend)",
"sig": "21e278fb5d1694b0385fc7b9e022c84f0db49f9f9eee5215c17eeee3ec11a61ea3b92c723721628a0912c871a0342630123bbda3264af98dfd0afbd09a7faa3e"
}