Rukain
|
  |
| Joined: 30 Jul 2013 |
| Total Posts: 1944 |
|
|
| 26 Nov 2013 09:02 PM |
Basically, the script creates small parts that are removed when they make contact with your character's Torso, increasing the player's Energy. The script works just fine, but after finishing, even after all the parts are removed, it causes a lot of lag. The frames of the attacks are delayed so a 1-second attack takes about 4 seconds to execute and such.
Thing is, after the player dies, the lag is cleared, and it doesn't even affect anyone else, only the user.
What is this and can it be fixed? |
|
|
| Report Abuse |
|
|
Kuroki
|
  |
| Joined: 27 Dec 2009 |
| Total Posts: 18058 |
|
|
| 26 Nov 2013 09:03 PM |
| Sounds like a memory leak. Paste the script. |
|
|
| Report Abuse |
|
|
Rukain
|
  |
| Joined: 30 Jul 2013 |
| Total Posts: 1944 |
|
|
| 26 Nov 2013 09:04 PM |
Works JUST FINE, it just leaves lag.
function charge() active = true script.Parent.Noreset.WalkSpeed = 3 while active == true do if active == false or script.Parent.Energy.Value >= 1000 then break end local p = blast1:clone() p.BrickColor = BrickColor.new("Institutional white") p.Size = Vector3.new(0.5,0.5,0.5) p.Anchored = false local s = Instance.new("SpecialMesh") s.MeshType = "Sphere" s.Parent = p local b = Instance.new("BodyPosition") b.Parent = p p.AncestryChanged:connect(function(p,new) trace(b,script.Parent.Torso) end) p.Parent = game.Workspace.CurrentCamera p.CFrame = script.Parent.Torso.CFrame * CFrame.Angles((math.random(1,628)/100),(math.random(1,628)/100),(math.random(1,628)/100)) p.CFrame = p.CFrame + p.CFrame.lookVector*6 b.position = script.Parent.Torso.Position p.Touched:connect(function(hit) add(p,hit,script.Parent.Energy,1) end) wait(0.04) end end |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Nov 2013 09:05 PM |
| A lot of body positions are laggy |
|
|
| Report Abuse |
|
|
|
| 26 Nov 2013 09:05 PM |
| Try adding it to Debris... |
|
|
| Report Abuse |
|
|
Rukain
|
  |
| Joined: 30 Jul 2013 |
| Total Posts: 1944 |
|
|
| 26 Nov 2013 09:06 PM |
| I thought making it localized would help, hence why it's in the CurrentCamera. So you think adding it to Debris instead will fix it? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Nov 2013 09:09 PM |
| Debris will just remove it in time. |
|
|
| Report Abuse |
|
|
Rukain
|
  |
| Joined: 30 Jul 2013 |
| Total Posts: 1944 |
|
|
| 26 Nov 2013 09:10 PM |
| Well the script removes it on contact with the Torso as is. It still leaves lag behind, after being destroyed. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Nov 2013 09:12 PM |
| Try to not put it as a local part. |
|
|
| Report Abuse |
|
|
Rukain
|
  |
| Joined: 30 Jul 2013 |
| Total Posts: 1944 |
|
|
| 26 Nov 2013 09:13 PM |
| It lagged when I put it into Workspace. I figure if a 664-part sword DOESN'T lag in the CurrentCamera, then neither would the charging attack, but it still does. |
|
|
| Report Abuse |
|
|