|
| 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 |
|
|
|
| 28 Feb 2015 03:55 PM |
| Oh, I think I see my problem. |
|
|
| Report Abuse |
|
|
|
| 28 Feb 2015 03:57 PM |
| Never mind, it isn't reason I think it is. Still doesn't work. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
|
| 01 Mar 2015 10:59 AM |
| Spread prints throughout the function and find out what line it 'stops' at. |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2015 11:02 AM |
| Can't you just use the debugger for this? |
|
|
| Report Abuse |
|
|