Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to code some sort of road building system, like Sim City or Skylines?

How to make a click, drag, and build road system, or click at one position and drag the mouse to another until the mouse button is up, creating a road between the two roads. The roads can also be connected to other roads.

Anything could help, like something in the wiki or i'll just put some money in a scripter to do it.

1 comment

0

plugins my b

1 answer

✓ Accepted answer

Even though this is kind of a request I will try to give you hints to make this. REMEMBER THAT THIS IS NOT FOR FE, THIS IS JUST AN EXAMPLE

First, make a model of something and then use the mouse .Move event.

local model = workspace.Model
local mouse = game.Players.LocalPlayer:GetMouse()

mouse.Move:Connect(function()
	if mouse.Hit.p ~= nil then
		model:MoveTo(mouse.Hit.p + Vector3.new(0,5,0))
		-- or you can use this
		model:SetPrimaryPartCFrame(mouse.Hit.p + + Vector3.new(0,5,0))
	end
end)

And for the clicking, there are many ways to do this, in this case I will clone it.

mouse.Button1Down:Connect(function()
	local new = model:Clone()
	new.Parent = workspace -- or anywhere you want
	new:MoveTo(mouse.Hit.p + Vector3.new(0,5,0))
	-- or
	new:SetPrimaryPartCFrame(mouse.Hit.p + + Vector3.new(0,5,0))
end)

If you want the model to be transparent before placing then, do it yourself, it's easy, use for loops to scan through parts

For the other things, try to search it yourself or learn from a free model

This discussion is preserved as it was. New answers, comments, and votes are closed.