Hello, I am currently making a game where you fight with cartons of milk (please don’t say it’s weird) and I have everything done except for the throwing part, which is not working for some reason. here it is:
script.Parent.Release.OnServerEvent:Connect(function()
if enabled == true and player.Character.Humanoid.Health > 0 then
enabled = false
game:GetService("TweenService"):Create(player.PlayerGui.ScreenGui.Frame.Frame,TweenInfo.new(.25,Enum.EasingStyle.Linear,Enum.EasingDirection.Out),{BackgroundColor3 = Color3.fromRGB(255, 255, 255)}):Play()
game:GetService("TweenService"):Create(player.PlayerGui.ScreenGui.Frame.Frame,TweenInfo.new(.25,Enum.EasingStyle.Linear,Enum.EasingDirection.Out),{Size = UDim2.new(0, 0, 1, 0)}):Play()
game:GetService("TweenService"):Create(player.PlayerGui.ScreenGui.Frame.TextLabel,TweenInfo.new(.25,Enum.EasingStyle.Linear,Enum.EasingDirection.Out),{TextColor3 = Color3.fromRGB(0, 0, 0)}):Play()
game:GetService("TweenService"):Create(player.PlayerGui.ScreenGui.Frame.TextLabel,TweenInfo.new(.25,Enum.EasingStyle.Back,Enum.EasingDirection.Out),{Size = UDim2.new(0.5, 0, 8, 0)}):Play()
game:GetService("TweenService"):Create(player.PlayerGui.ScreenGui.Frame.TextLabel,TweenInfo.new(.25,Enum.EasingStyle.Linear,Enum.EasingDirection.Out),{Rotation = 0}):Play()
player.PlayerGui.ScreenGui.Frame.TextLabel.Text = "0%"
local anim5 = Instance.new("Animation") anim5.AnimationId = "rbxassetid://12569467169"
local Throw = player.Character:WaitForChild("Humanoid"):LoadAnimation(anim5)
Throw:Play()
Charge:Stop()
ChargeIdle:Stop()
----Here is where the cloning part starts
wait(.25)
local HumanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart")
local BodyVelocity = Instance.new("BodyVelocity")
local Direction = CFrame.new(HumanoidRootPart.Position, HumanoidRootPart.Position)
BodyVelocity.maxForce = Vector3.new(math.huge,math.huge,math.huge)
BodyVelocity.Velocity = Direction.lookVector * 50 + (charge / 3)
local milk = game.ReplicatedStorage.Milk:Clone()
milk.Parent = game.Workspace
BodyVelocity.Parent = milk
milk.Position = player.Character.Head.Position
script.Parent.Handle.Throw:Play()
milk.Power.Value = charge
milk.Player.Value = player.Name
wait()
charge = 0
----Here is where the cloning part ends
script.Parent.Handle.Transparency = 1
wait(.25)
local anim6 = Instance.new("Animation") anim6.AnimationId = "rbxassetid://12560800030"
local Search = player.Character:WaitForChild("Humanoid"):LoadAnimation(anim6)
Search:Play()
wait(1)
script.Parent.Handle.Transparency = 0
Equip:Play()
wait(.5)
Idle:Play()
enabled = true
end
end)
(There are no errors, the script runs perfectly, almost as if its just skipping the part I need.)