-
What do you want to achieve? Keep it simple and clear!
I wanted to make the can fly while throwing but instead it just falls. -
What is the issue? Include screenshots / videos if possible!
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local Handle = script.Parent
local HitDebounce = false
Handle.Weld:Destroy()
-- This is part that wont work
Handle.SodaFly.P = 1250
Handle.SodaFly.Velocity = Vector3.new(Handle.ThrowTo.WorldCFrame.X-Handle.Throw.WorldCFrame.X,0,Handle.ThrowTo.WorldCFrame.Z-Handle.Throw.WorldCFrame.Z)
print(Handle.Throw.WorldCFrame.LookVector.X)
print(Handle.Throw.WorldCFrame.LookVector.Z)
-- This is part that wont work
game.TweenService:Create(Handle.SodaFly,TweenInfo.new(4,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{P = 0}):Play()
Handle.Touched:Connect(function(Hit)
if HitDebounce == false then
HitDebounce = true
if Hit.Parent:FindFirstChildOfClass("Humanoid") then
if (Handle.Velocity.X + Handle.Velocity.Z) >= 20 then
local Ball = Instance.new("Part",workspace.Game.Debris)
Ball.Shape = Enum.PartType.Ball
Ball.Anchored = true
Ball.CanCollide = false
Ball.Color = Color3.new(1,1,1)
Ball.Size = Vector3.new(0,0,0)
Ball.Position = Handle.Position
game.TweenService:Create(Ball,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{Size = Vector3.new(2,2,2),Transparency = 1}):Play()
Hit.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(35)
else
Hit.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(15)
end
else
if (Handle.Velocity.X + Handle.Velocity.Z) >= 20 then
local Ball = Instance.new("Part",workspace.Game.Debris)
Ball.Shape = Enum.PartType.Ball
Ball.Anchored = true
Ball.CanCollide = false
Ball.Color = Color3.new(1,1,1)
Ball.Size = Vector3.new(0,0,0)
Ball.Position = Handle.Position
game.TweenService:Create(Ball,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{Size = Vector3.new(2,2,2),Transparency = 1}):Play()
else
end
end
end
end)
Handle.CanTouch = false
Handle.CanCollide = false
wait(0.5)
Handle.CanTouch = true
Handle.CanCollide = true