wait nope even without tween it dosent work
local Shoot = script.Parent:WaitForChild("Shoot")
local Box = script:WaitForChild("Box")
local Beams = workspace:WaitForChild("Beams")
local Plr = game.Players.LocalPlayer
local Mouse = Plr:GetMouse()
local RS = game:GetService("RunService")
local Char = Plr.Character or Plr.CharacterAdded:Wait()
local HeadAt = Instance.new("Attachment")
HeadAt.Parent = Shoot
local TS = game:GetService("TweenService")
local Info1 = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,0)
local Info2 = TweenInfo.new(0.1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,false,0)
local CFrames = nil
local Tween = nil
local Playing = false
local function setpos(SizeX,SizeY,Num)
local Postable = {
Vector3.new(0,SizeY/3,SizeX/3),
Vector3.new(0,-SizeY/3,SizeX/3),
Vector3.new(0,SizeY/3,-SizeX/3),
Vector3.new(0,-SizeY/3,-SizeX/3)
}
return Postable[Num]
end
RS.RenderStepped:Connect(function()
for i,v in pairs(Beams:GetChildren()) do
local CT0 = TS:Create(v,Info2,{CurveSize0 = math.random(-10,10)})
local CT1 = TS:Create(v,Info2,{CurveSize1 = math.random(-10,10)})
CT0:Play()
CT1:Play()
end
if Target~= nil and Box.Adornee ~= nil and Target.Anchored == false then
CFrames = Shoot.CFrame
if Playing then
return
end
Tween = TS:Create(Target,Info1,{CFrame = CFrames*CFrame.new(Vector3.new(25,0,0))})
Playing = true
Tween:Play()
Tween.Completed:Connect(function()
Playing = false
end)
end
end)
Mouse.Button1Down:Connect(function()
Target = Mouse.Target
if Target~= nil and Target:IsA("BasePart") and Target.Anchored == false then
Box.Adornee = Target
for i,v in pairs(Beams:GetChildren()) do
local At = Instance.new("Attachment")
At.Parent = Target
At.Position = setpos(Target.Size.X,Target.Size.Y,i)
v.Attachment1 = At
v.Attachment0 = HeadAt
end
end
end)
Mouse.Button1Up:Connect(function()
if CFrames and Playing then
print(Target.Velocity)
Tween:Cancel()
end
for i,v in pairs(Target:GetChildren()) do
if v:IsA("Attachment") then
v:Destroy()
end
end
Box.Adornee = nil
end)