Hi,
I don´t know how I can make a Part like in the House where I can´t spawn vehicul on it?
Please can me help someone?
Best regards
Hi,
I don´t know how I can make a Part like in the House where I can´t spawn vehicul on it?
Please can me help someone?
Best regards
How are you spawning vehicles now?
If you are using a script or tool you will need to have the script or tool check to see if it is possible to spawn the car or not at that location.
This is the spawn script:
local ServerStorage = game:GetService(“ServerStorage”)
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local SpawnCarEvent = ReplicatedStorage:WaitForChild(“SpawnCar”)
local DeleteCarEvent = ReplicatedStorage:WaitForChild(“DeleteCar”)
SpawnCarEvent.OnServerEvent:Connect(function(player, carName)
local Car = ServerStorage:FindFirstChild(“Cars”):FindFirstChild(carName)
local CurCar = game.Workspace:FindFirstChild(player.Name … ‘sCar’)
if CurCar then
CurCar:Remove()
end
if Car then
local clonedCar = Car:Clone()
clonedCar.Name = player.Name … ‘sCar’
clonedCar.Parent = game.Workspace
clonedCar:MoveTo(player.Character.HumanoidRootPart.Position + player.Character.HumanoidRootPart.CFrame.LookVector * 15)
end
end)
DeleteCarEvent.OnServerEvent:Connect(function(player, Car)
local Car = game.Workspace:FindFirstChild(player.Name … ‘sCar’)
if Car then
Car:Remove()
end
end)
game.Players.PlayerRemoving:Connect(function(player)
local Car = game.Workspace:FindFirstChild(player.Name … ‘sCar’)
if Car then
Car:Remove()
end
end)
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local Car = game.Workspace:FindFirstChild(player.Name … ‘sCar’)
if Car then
Car:Remove()
end
end)
end)
You could make a brick called a “zone” and make it invisible and can’t collide, etc, if they are in that zone or their humanoidrootpart is a certain distance near it then the function won’t run
Any idea on the script we need to put in the brick? I have same issue and would like to use this method.