generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Is there a fix for this after-lag?

Previous Thread :: Next Thread 
Rukain is not online. 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 is not online. 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 is not online. 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 is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Nov 2013 09:05 PM
A lot of body positions are laggy
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
26 Nov 2013 09:05 PM
Try adding it to Debris...
Report Abuse
Rukain is not online. 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 is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Nov 2013 09:09 PM
Debris will just remove it in time.
Report Abuse
Rukain is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image