So, i'm making a Singleplayer game where if you click it makes a part, But, I want you to be able to hold down MouseButton1 and parts to appear every 0.2 seconds, How would i fix that?
Here's my script
01 | local lp = game.Players.LocalPlayer |
02 | local rs = game:GetService( "RunService" ) |
03 | players = game:GetService( "Players" ) |
04 |
05 |
06 |
07 | --------------------------------------------- |
08 |
09 | local mouse = lp:GetMouse() |
10 |
11 | --------------------------------------------- |
12 |
13 | script.Parent.Activated:Connect( function () |
14 | local x = game.Workspace.Particle:Clone() |
15 | x.Name = 'Parciclepart' |
Thanks for reading, Help it appreciated.
01 | local Player = game:GetService( "Players" ).LocalPlayer |
02 | local RunService = game:GetService( "RunService" ) |
03 | local UserInputService = game:GetService( "UserInputService" ) |
04 |
05 | local mouse = Players:GetMouse() |
06 |
07 | script.Parent.Activated:Connect( function () |
08 | local pressed = true |
09 | while pressed do -- repeat as long as the mouse button is pressed |
10 | -- clone the part |
11 | local x = workspace.Particle:Clone() |
12 | x.Name = "ParticlePart" |
13 | x.Position = mouse.Hit.Position |
14 | x.Parent = workspace |
15 |