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 » Scripters
Home Search
 

Re: Function doesn't reach last print statement.

Previous Thread :: Next Thread 
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
28 Feb 2015 03:54 PM
I'm having a problem in my function for the PlayerRemoving event and I cannot figure out why this prints the refund value for the player, but doesn't reach the final print statement that confirms it finished.

function removeLab(player, stats)
local lab = stats.Lab
if lab.Value then
lab = lab.Value
local statistics = lab.Statistics
local owner = statistics.Owner
if owner.Value == player then
local backUp = clonedLabs[statistics.Serial.Value]
if backUp then -- Try to make it so 1 clone handles all (or default ones in the table)
print('Refunding ' .. statistics.Refund.Value .. ' to ' .. player.Name) -- prints
stats.Balance.Value = stats.Balance.Value + statistics.Refund.Value;
statistics.Refund.Value = 0;
local clone = backUp:Clone()
lab:Destroy()
wait(0.5)
clone.Parent = workspace
clone:MakeJoints()
end
end
end
print('Replaced lab for ' .. player.Name) -- doesn't print
end
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
28 Feb 2015 03:55 PM
Oh, I think I see my problem.
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
28 Feb 2015 03:57 PM
Never mind, it isn't reason I think it is. Still doesn't work.
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
28 Feb 2015 04:06 PM
Additional information:

Everything is defined, and it prints on online servers in studio, but not in 'Play Solo' or real games. FilteringEnabled is on.
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
01 Mar 2015 10:52 AM
bump
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
01 Mar 2015 10:59 AM
Spread prints throughout the function and find out what line it 'stops' at.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
01 Mar 2015 11:02 AM
Can't you just use the debugger for this?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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