DrawFloor.Start = function(player, mouse)
local PlayersPlot = Plots:FindFirstChild(player.Name)
if not PlayersPlot then return end
local Floor = Instance.new('Model', PlayersPlot.CameraPart)
Floor.Name = 'Floor'
local Point = CreatePoint('Point', Floor)
local LowerX, UpperX, LowerZ, UpperZ = CheckBase(PlayersPlot.Base)
local RenderStepped
local Click
mouse.TargetFilter = Floor
RenderStepped = RunService.RenderStepped:Connect(function()
RenderPosition(PlayersPlot, mouse.Hit.p, Point, LowerX, UpperX, LowerZ, UpperZ)
end)
Click = mouse.Button1Down:Connect(function()
RenderStepped:Disconnect()
Click:Disconnect()
local Point = CreatePoint('Point', Floor)
RenderStepped = RunService.RenderStepped:Connect(function()
RenderPosition(PlayersPlot, mouse.Hit.p, Point, LowerX, UpperX, LowerZ, UpperZ)
end)
Click = mouse.Button1Down:Connect(function()
RenderStepped:Disconnect()
Click:Disconnect()
local Point = CreatePoint('Point', Floor)
RenderStepped = RunService.RenderStepped:Connect(function()
RenderPosition(PlayersPlot, mouse.Hit.p, Point, LowerX, UpperX, LowerZ, UpperZ)
end)
Click = mouse.Button1Down:Connect(function()
RenderStepped:Disconnect()
Click:Disconnect()
local Point = CreatePoint('Point', Floor)
RenderStepped = RunService.RenderStepped:Connect(function()
RenderPosition(PlayersPlot, mouse.Hit.p, Point, LowerX, UpperX, LowerZ, UpperZ)
end)
Click = mouse.Button1Down:Connect(function()
RenderStepped:Disconnect()
Click:Disconnect()
local Point = CreatePoint('Point', Floor)
RenderStepped = RunService.RenderStepped:Connect(function()
RenderPosition(PlayersPlot, mouse.Hit.p, Point, LowerX, UpperX, LowerZ, UpperZ)
end)
end)
end)
end)
end)
end
Basically, evntually, I’m trying to create something that fills in an area given a set amount of ‘points’, like this
But that’s not the important part atm. What I’m currently having trouble figuring out is how to let players continue to place points, until they hit a max number, say 10?
Atm what I have is just whenever they click, it repeats the code of creating a point and said point following the mouse, but for the player to create 10 points, I’d have to have this
Click = mouse.Button1Down:Connect(function()
RenderStepped:Disconnect()
Click:Disconnect()
local Point = CreatePoint('Point', Floor)
RenderStepped = RunService.RenderStepped:Connect(function()
RenderPosition(PlayersPlot, mouse.Hit.p, Point, LowerX, UpperX, LowerZ, UpperZ)
end)
end)
run 10 times.
In the top example of code I have it run 5 times, which just looks really congestive