The part isn't removing instantly. [?]
Asked by
8 years ago Edited 8 years ago
Hello, I've made a simply fire ball script. (Fully FE)
There is a local script inside player's backpack so when player hits the button (x) then
it sends a request to remote event to fire.
Server script does all the work. But the main problem lies in Affect Script
I'm not sure how to explain it but I'll try my best :)
When the ball hits the player it should instantly remove but instead of it goes a bit further and then removes. For me it stutters. Somehow it works good in solo mode.
Is there any way to "fix" it? Have you ever had such a problem?
Server script gives the affect script to the ball
Here is the Affect Script:
01 | local ServerStorage = game:GetService( "ServerStorage" ) |
02 | local LightExplosion = ServerStorage:WaitForChild( "Effects" ):WaitForChild( "Explosions" ):WaitForChild( "LightExpl" ):Clone() |
03 | local DarkExplosion = ServerStorage:WaitForChild( "Effects" ):WaitForChild( "Explosions" ):WaitForChild( "DarkExpl" ):Clone() |
05 | local Magic = script.Parent |
06 | local Owner = script:WaitForChild( "Owner" ) |
07 | local Type = script:WaitForChild( "Type" ) |
09 | Magic.Touched:connect( function (Hit) |
11 | local Humanoid = Hit.Parent:FindFirstChild( "Humanoid" ) |
12 | local Torso = Hit.Parent:FindFirstChild( "Torso" ) |
15 | if Humanoid and Humanoid.Health > 0 and Torso and Hit.Parent.Name ~ = Owner.Value then |
16 | if Type.Value = = "DShot1" then |
18 | local BodyVel = Magic:FindFirstChild( "BodyVelocity" ):Clone() |
19 | DarkExplosion.Parent = Torso |
20 | game.Debris:AddItem(DarkExplosion, 0.5 ) |
21 | script.Parent = Hit.Parent |
22 | Humanoid:TakeDamage( 30 ) |
25 | DarkExplosion.Enabled = false |