hey, i’m trying to make a tent placement system and wanted to ask about the best way to handle restricted areas—like places where players shouldn’t be able to place tents.
i’m still pretty new to advanced scripting, so i’m not totally sure how to approach this. i was thinking maybe using invisible parts for “zones”, and then doing a check like: if the player is inside one of those parts, they can’t place a tent. would that work? or is there a better or more efficient way to handle that?
← current script
feel free to improve this if youd like cause it is a bit glitchy… all the time
local rs = game:GetService("ReplicatedStorage")
local event = ReplicatedStorage:WaitForChild("PlaceTentEvent")
local temp = ReplicatedStorage:WaitForChild("Tent")
event.OnServerEvent:Connect(function(player, position)
local new = temp:Clone()
new:SetPrimaryPartCFrame(CFrame.new(position + Vector3.new(0, newTent.PrimaryPart.Size.Y/2, 0)))
new.Parent = workspace
end)
i’ve seen these placement systems in a few games, but i’m not sure how they keep them so smooth and lag-free. if anyone knows how they optimize it or has tips, i’d really appreciate it.