generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: smooth draw script?

Previous Thread :: Next Thread 
Equivoques is not online. Equivoques
Joined: 02 Jan 2016
Total Posts: 3
06 Jan 2016 12:59 AM
i made this:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

local b1down = false

mouse.Button1Down:connect(function()
b1down = true
end)

mouse.Button1Up:connect(function()
b1down = false
end)

rs = game:GetService("RunService")

rs.RenderStepped:connect(function()
wait()
if b1down == true then
local ink = Instance.new("Frame")
ink.Size = UDim2.new(0,2,0,2)
ink.BackgroundColor3 = Color3.new()
ink.Parent = script.Parent.Parent
ink.Name = "InkSeg"
ink.Position = UDim2.new(0, mouse.X, 0, mouse.Y)
end
end)



but the segments's offset occasionally moves too far

fried not baked
Report Abuse
AkaLua is not online. AkaLua
Joined: 27 Jul 2012
Total Posts: 526
06 Jan 2016 01:50 AM
Do you mean there is gaps between the ink dots? That is because the mouse is moving too fast. There is not much you can do except maybe make the dots half the distance away from each other but I'm too tired to work out how to do that right now.


-____________________________-
Report Abuse
HarrySnotte is not online. HarrySnotte
Joined: 27 Jun 2011
Total Posts: 2854
06 Jan 2016 01:59 AM
You could also just fill the gap between the two last dots each time the RenderStepped fires.
Report Abuse
AkaLua is not online. AkaLua
Joined: 27 Jul 2012
Total Posts: 526
06 Jan 2016 02:05 AM

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

local b1down = false

mouse.Button1Down:connect(function()
b1down = true
end)

mouse.Button1Up:connect(function()
b1down = false
end)

local lastX
local lastY

rs.RenderStepped:connect(function()
wait()
if b1down == true then
for x = 1,mouse.X-lastX do
for y = 1,mouse.X-lastY do
local ink = Instance.new("Frame")
ink.Size = UDim2.new(0,2,0,2)
ink.BackgroundColor3 = Color3.new()
ink.Parent = script.Parent.Parent
ink.Name = "InkSeg"
ink.Position = UDim2.new(0, x, 0, y)
end
lastX = mouse.X
lastY = mouse.Y
end
end
end)

I think thatd do it


-____________________________-
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
06 Jan 2016 02:13 AM
Remove the "wait()" from it, if you want a ~0.03 delay just use a while loop.


Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
06 Jan 2016 02:29 AM
Create frames that are X by Y. Color the frames that the mouse corresponds to. Much simpler. See my Image Library Example place for more details.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image