So, what I am trying to do is make a "The Flash" script. So far what it does is, makes a few parts when I move but then stops making parts. I want to continuously place parts as I am moving, it just makes a few.
function showLightning(on,char)
if on == true then
local part = Instance.new('Part')
part.Anchored = true
part.CanCollide = false
part.Size = Vector3.new(1,4,3)
part.BrickColor = BrickColor.new('Bright yellow')
part.Transparency = .6
part.CFrame = char.Torso.CFrame * CFrame.new(0,0,3)
part.Parent = workspace
else
print'a'
end
end
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
char:FindFirstChild('Humanoid').Running:connect(function(speed)
if speed >= 4 then
showLightning(true, char)
elseif speed <= 1 then
showLightning(false, char)
end
end)
end)
end)

2 comments
Why do wait(1/10) and not wait(.1)?
They are equal.