Filtering enabled bug that stops fire and player flying, or am I doing something wrong?
Every single time I use anything with BodyForce or BodyVelocity (Filtering Enabled) there is ALWAYS the same type of bug. The Output and Console says there is no errors.
Right now I'm making flying
Local Script in Player Backpack
01 | workspace.General.Cooldown.Create:FireServer() |
02 | workspace.General.ClickDetector.Clicker:FireServer() |
03 | UserInput = game:GetService( "UserInputService" ) |
04 | workspace:WaitForChild(game.Players.LocalPlayer.Name) |
05 | UserInput.InputBegan:connect( function (Input) |
06 | if Input.KeyCode = = Enum.KeyCode.LeftAlt or Input.KeyCode = = Enum.KeyCode.RightAlt then |
07 | workspace.General.Fly.Up:FireServer() |
10 | UserInput.InputEnded:connect( function (Input) |
11 | if Input.KeyCode = = Enum.KeyCode.LeftAlt or Input.KeyCode = = Enum.KeyCode.RightAlt then |
12 | workspace.General.Fly.Stop:FireServer() |
15 | Mouse = game.Players.LocalPlayer:GetMouse() |
16 | Mouse.Button 1 Down:connect( function () |
17 | if game.Players.LocalPlayer.Character.UpperTorso:FindFirstChild( "Fly" ) ~ = nil then |
18 | workspace.General.Fly.Move:FireServer() |
21 | Mouse.Button 1 Up:connect( function () |
22 | if game.Players.LocalPlayer.Character.UpperTorso:FindFirstChild( "Fly" ) ~ = nil then |
23 | workspace.General.Fly.Stop:FireServer() |
26 | UserInput.InputBegan:connect( function (Input) |
27 | if Input.KeyCode = = Enum.KeyCode.LeftShift or Input.KeyCode = = Enum.KeyCode.RightShift then |
28 | workspace.General.Fly.Fast:FireServer() |
31 | UserInput.InputEnded:connect( function (Input) |
32 | if Input.KeyCode = = Enum.KeyCode.LeftShift or Input.KeyCode = = Enum.KeyCode.RightShift then |
33 | workspace.General.Fly.Slow:FireServer() |
36 | UserInput.InputBegan:connect( function (Input) |
37 | if game.Players.LocalPlayer.Character.UpperTorso:FindFirstChild( "Fly" ) ~ = nil then |
38 | if Input.KeyCode = = Enum.KeyCode.Space then |
39 | workspace.General.Fly.Down:FireServer() |
43 | UserInput.InputEnded:connect( function (Input) |
44 | if Input.KeyCode = = Enum.KeyCode.Space then |
45 | if game.Players.LocalPlayer.Character.UpperTorso:FindFirstChild( "Fly" ) ~ = nil then |
46 | workspace.General.Fly.Stop:FireServer() |
50 | game.Players.LocalPlayer.Character.UpperTorso.ChildRemoved:connect( function (Part) |
51 | if Part.Name = = "Fly" then |
52 | workspace.General.Fly.StopScript.Stop:FireServer() |
56 | workspace.General.Fly.Up:FireServer() |
59 | if game.Players.LocalPlayer.Character.UpperTorso:FindFirstChild( "Fly" ) ~ = nil then |
60 | workspace.General.Fly.Stop:FireServer() |
64 | if game.Players.LocalPlayer.Character.UpperTorso:FindFirstChild( "Fly" ) ~ = nil then |
65 | workspace.General.Fly.Down:FireServer() |
68 | ContextAction = game:GetService( "ContextActionService" ) |
69 | local FloatUp = ContextAction:BindAction( "FloatUp" , FloatU, true ) |
70 | ContextAction:SetPosition( "FloatUp" , UDim 2. new( 1 , - 50 , 0.1 , - 100 )) |
72 | local FloatStop = ContextAction:BindAction( "FloatStop" , Stop, true ) |
73 | ContextAction:SetPosition( "FloatStop" , UDim 2. new( 1 , - 50 , 0.1 , - 50 )) |
75 | local FloatDown = ContextAction:BindAction( "FloatDown" , FloatD, true ) |
76 | ContextAction:SetPosition( "FloatDown" , UDim 2. new( 1 , - 50 , 0.1 , 0 )) |
Script in Workspace > General named Fly:
04 | script.Up.OnServerEvent:connect( function (Client) |
05 | local Char = Client.Character |
06 | if Client.Backpack.Element.Value = = "Fire" then |
07 | if Char.UpperTorso:FindFirstChild( "Fire" ) = = nil then |
08 | local Flame = workspace.Fire.FireBall [ "Fire Volley" ] .Fire:Clone() |
09 | Flame.Parent = Char.UpperTorso |
12 | for i, v in pairs (Char.Humanoid:GetPlayingAnimationTracks()) do |
15 | Char.Animate.Disabled = true |
16 | local Anim = Char.Humanoid:LoadAnimation(script.UpAnim) |
19 | if not Char.UpperTorso:FindFirstChild( "Fly" ) then |
20 | local Fly = Instance.new( "BodyVelocity" , Char.UpperTorso) |
22 | Fly.MaxForce = Vector 3. new( math.huge , math.huge , math.huge ) |
23 | Fly.Velocity = Vector 3. new( 0 , Speed, 0 ) |
24 | elseif Char.UpperTorso:FindFirstChild( "Fly" ) then |
25 | local Fly = Char.UpperTorso.Fly |
26 | Fly.Velocity = Vector 3. new( 0 , Speed, 0 ) |
31 | local Char = Client.Character |
32 | for i, v in pairs (Char.Humanoid:GetPlayingAnimationTracks()) do |
36 | Char.Animate.Disabled = true |
37 | local Anim = Char.Humanoid:LoadAnimation(script.DownAnim) |
40 | if Char.UpperTorso:FindFirstChild( "Fly" ) then |
41 | local Fly = Char.UpperTorso.Fly |
42 | Fly.Velocity = Vector 3. new( 0 , Speed * - 10 , 0 ) |
43 | for i, v in ipairs (Char:GetChildren()) do |
44 | if v:IsA( "MeshPart" ) then |
45 | v.Touched:connect( function (hit) |
47 | if Char.UpperTorso:FindFirstChild( "Fire" ) ~ = nil then |
48 | Char.UpperTorso.Fire.Enabled = false |
49 | game:GetService( "Debris" ):AddItem(Char.UpperTorso.Fire, 5 ) |
51 | Char.Animate.Disabled = false |
60 | local Char = Client.Character |
61 | for i, v in pairs (Char.Humanoid:GetPlayingAnimationTracks()) do |
65 | Char.Animate.Disabled = true |
66 | local Anim = Char.Humanoid:LoadAnimation(script.MoveAnim) |
68 | local Mouse = Client:GetMouse() |
69 | Char.HumanoidRootPart.CFrame = CFrame.new(Char.HumanoidRootPart.Position, Mouse.Hit.p) |
70 | Char.UpperTorso.Fly.Velocity = Char.HumanoidRootPart.CFrame.lookVector * Speed * 10 |
71 | Mouse.Move:connect( function () |
73 | Char.HumanoidRootPart.CFrame = CFrame.new(Char.HumanoidRootPart.Position, Mouse.Hit.p) |
74 | Char.UpperTorso.Fly.Velocity = Char.HumanoidRootPart.CFrame.lookVector * Speed * 10 |
80 | local Char = Client.Character |
81 | for i, v in pairs (Char.Humanoid:GetPlayingAnimationTracks()) do |
84 | Char.Animate.Disabled = true |
85 | local Anim = Char.Humanoid:LoadAnimation(script.Idle) |
87 | Char.UpperTorso.Fly.Velocity = Vector 3. new( 0 , 0 , 0 ) |
90 | script.Fast.OnServerEvent:connect( function () |
93 | script.Slow.OnServerEvent:connect( function () |