One that does not ignore targetfilter. Any help? (I'm a little amateur with working the mouse)
This is all the coding you need to know:
Wait(); local max_power=125;--the maximum amount of power that can be reached local deb=false;--is the mouse being held or not? local throwing=false;--is the ball being thrown or not? local power=0;--the current power being used local keys={};--table for keys being pressed --associative array for background local frame_ary={ ['BackgroundColor3']=Color3.new(50/255,50/255,50/255); ['BackgroundTransparency']=0.1; ['BorderColor3']=Color3.new(1,1,1); ['Position']=UDim2.new(0.1,0,0.5,0); ['Size']=UDim2.new(0.025,0,0.3,0); }; --associative array for charge ball local bar_ary={ ['BackgroundColor3']=Color3.new(50/255,1,50/255); ['BorderSizePixel']=0; }; --colors the bar the proper color function color(bar) bar.BackgroundColor3=Color3.new(power/max_power,1-power/max_power,0); end --associative array for Instance type name function doit(array,name) local a=Instance.new(name); for i,v in pairs(array) do if pcall(function() return a[i]; end) then a[i]=v; end end return a; end --throws the ball function fire(v,power) local vCharacter = game.Players.LocalPlayer.Character; local vPlayer = game.Players.LocalPlayer; local thing = script.Parent:Clone(); local missile = thing.Handle local spawnPos = vCharacter.PrimaryPart.Position spawnPos = spawnPos + (v * 10) targetPos = spawnPos + (v * power) missile.Position = spawnPos missile.Velocity = v * power missile.CanCollide = true missile.Elasticity = .05 missile.Friction = .7 missile.CFrame=CFrame.new(spawnPos,targetPos)*CFrame.Angles(math.rad(90),0,0); local bodyp = Instance.new("BodyVelocity") bodyp.maxForce = Vector3.new(1e3,1e3,1e3) bodyp.P = power*100; bodyp.velocity = (targetPos-missile.CFrame.p).unit*power bodyp.Parent = missile local new_script = script.Script:clone() new_script.Name=tostring(power); new_script.Disabled = false new_script.Parent = missile thing.Parent = game.Workspace game:GetService("Debris"):AddItem(script.Parent,0); end --if the handle is touched while in handoff position script.Parent.Handle.Touched:connect(function(part) if keys['x'] and part.Parent:findFirstChild("Humanoid") then keys['x']=false; script.Parent.GripPos=Vector3.new(0.2,0.2,0.3); script.Parent.GripForward=Vector3.new(0.7688,0.4522,-0.4522); script.Parent.GripUp= Vector3.new(-0.5687,0.8068,-0.16); script.Parent.GripRight= Vector3.new(0.2925,0.3802,0.8774); script.Parent.Parent=part.Parent; end end ); --when the tool is equipped script.Parent.Equipped:connect(function(mouse) mouse.Icon = "rbxasset://textures\\GunCursor.png"; --when clicked mouse.Button1Down:connect(function() power=0; throwing=true; deb=true; local sg=Instance.new("ScreenGui",game.Players.LocalPlayer.PlayerGui); local frame=doit(frame_ary,"Frame"); frame.Parent=sg; local bar=doit(bar_ary,"Frame"); bar.Parent=frame; while deb do power=power<max_power and power+8 or max_power; bar.Size=UDim2.new(1,0,power/max_power,0); bar.Position=UDim2.new(0,0,1-power/max_power,0); color(bar); Wait(); end if throwing then game:GetService("Debris"):AddItem(sg,0); fire((mouse.Hit.p-game.Players.LocalPlayer.Character.Head.Position).unit,power); power=0; end end ); --when released mouse.Button1Up:connect(function() deb=false; end ); --when a key is pressed mouse.KeyDown:connect(function(key) keys[key]=true; --if handoff motion if key:lower()=="x" then while keys[key:lower()] do script.Parent.GripPos=Vector3.new(0,0.5,0); script.Parent.GripForward=Vector3.new(0,0,0); script.Parent.GripUp= Vector3.new(0,0,0); script.Parent.GripRight= Vector3.new(0,0,1); Wait(); end script.Parent.GripPos=Vector3.new(0.2,0.2,0.3); script.Parent.GripForward=Vector3.new(0.7688,0.4522,-0.4522); script.Parent.GripUp= Vector3.new(-0.5687,0.8068,-0.16); script.Parent.GripRight= Vector3.new(0.2925,0.3802,0.8774); end end ); --when a key is released mouse.KeyUp:connect(function(key) keys[key:lower()]=false; end ); end );
(can be found in almost any roblox football, such as this one: https://www.roblox.com/KillKays-Official-Football-item?id=269511297
You could create your own method instead of using mouse.Target, or mouse.Hit. ROBLOX allows you to create formats for that kind of stuff.