I have a union that I clone in a function that I want to go infinitey in the x or y positions based on where they clicked, but how do I make it not fall do to gravity?
fireWizardCallXOutFunction.OnServerEvent:connect(function(player,mouseHit) local lmbWaitTimeLeft = player.Backpack.PlayerData.InGameData.Cooldowns.LMBCooldown.Value local lmbWaitTime = game.ReplicatedStorage.Info.Characters.FireWizard.LMBAttack.Attack2Cooldown.Value local torso = player.Character.HumanoidRootPart local xout = game.ServerStorage.XOut local xoutCopy = xout:Clone() xoutCopy.Parent = game.Workspace xoutCopy.Position = torso.Position xoutCopy.CFrame = player.Character:WaitForChild("HumanoidRootPart").CFrame xoutCopy.Velocity = mouseHit * 25 player.Backpack.PlayerData.InGameData.Cooldowns.LMBCooldown.Value = lmbWaitTime end)
Local Script Function:
local mouse = player:GetMouse(); mouse.Button1Down:connect(function() local lmbWaitTimeLeft = game.Players.LocalPlayer:WaitForChild("Backpack").PlayerData.InGameData.Cooldowns.LMBCooldown.Value if lmbWaitTimeLeft == 0 and not xoutAttackCalled then xoutAttackCalled = true local mouseHit = mouse.Hit.lookVector local animation = game.Workspace.Animations.FireWizard.xoutAttackAnimation local trackAnimation = nil trackAnimation = player.Character.Humanoid:LoadAnimation(animation) player.Character.Humanoid.WalkSpeed = 0 player.Character.Humanoid.JumpPower = 0 trackAnimation:Play() wait(2) fireWizardCallXOutFunction:FireServer(mouseHit) player.Character.Humanoid.WalkSpeed = 16 player.Character.Humanoid.JumpPower = 50 xoutAttackCalled = false end end)
The roblox wiki does a good job showing how to do this: http://wiki.roblox.com/index.php?title=Gravity