|
| 08 Nov 2016 12:34 PM |
A game I am drafting up has the potential to break if a player resets their character. The game is GUI based, and death is not possible through normal gameplay. Important information is saved through data persistance in a character's gui, and if I recall correctly the values are set to a default value if a character were to die.
I could work around this annoyance by saving values elsewhere, but if another fix is available I would prefer that option. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 08 Nov 2016 12:46 PM |
Yes.
--local script
local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:wait() local human = char:WaitForChild('Humanoid') human.Name = 'Human'
|
|
|
| Report Abuse |
|
|
|
| 08 Nov 2016 12:50 PM |
Changing the humanoid name is not only irksome and potentially game-breaking, it is no longer needed: http://devforum.roblox.com/t/customizable-reset-button-logic/30463 |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2016 03:36 PM |
| Came out yesterday. That's awesome. Thank you everyone! |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 08 Nov 2016 03:42 PM |
'and potentially game-breaking'
Not if you know what you are doing.
|
|
|
| Report Abuse |
|
|
|
| 08 Nov 2016 03:45 PM |
| You're right, because I myself have made a game with custom named humanoids and it works fine, it's just so hackish and ew. |
|
|
| Report Abuse |
|
|
j_sherman
|
  |
| Joined: 05 Jun 2009 |
| Total Posts: 1199 |
|
|
| 08 Nov 2016 03:50 PM |
game:GetService("StarterGui"):SetCore("ResetButtonCallback", false) that disables resetting
|
|
|
| Report Abuse |
|
|
|
| 08 Nov 2016 03:55 PM |
| The game has no use for humanoids, so either method works. |
|
|
| Report Abuse |
|
|
jody7777
|
  |
| Joined: 22 Feb 2009 |
| Total Posts: 1343 |
|
|
| 08 Nov 2016 11:17 PM |
it's a bad practice @TimeTicks
FOR THE CAUSE |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2016 02:22 AM |
| SetCore actually disables the reset button, changing the Humanoid name just breaks it. |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2016 06:58 AM |
yea cuz for some reason dumb roblox did something like pcall(function() game.Players.LocalPlayer.Character.Humanoid.Health=0 end) so if its not called humanoid it won't run |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2016 07:05 AM |
funny thing is that u can fix that by setting the callback to a bindable event with this connection game.Players.Character:BreakJoints() |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Nov 2016 08:20 AM |
| Roblox left it that way intentionally, and wrapping it in a pcall would be stupid. |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2016 10:57 AM |
| no I'm saying roblox runs it like a pcall because no errors appear |
|
|
| Report Abuse |
|
|
Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37141 |
|
|
| 10 Nov 2016 11:13 AM |
The real question is... why are you still using data persistence?
DataStores are way better and are not deprecated.
I have a spider on my back. |
|
|
| Report Abuse |
|
|
mybowls72
|
  |
| Joined: 05 Aug 2013 |
| Total Posts: 2688 |
|
|
| 10 Nov 2016 11:17 AM |
Change the name of the Humanoid.
I dont have a spider on my back |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2016 11:20 AM |
Or they could use humanoid = FindFirstChild("Humanoid") if humanoid then humanoid.Health = 0 end
https://www.roblox.com/library/359444683/H-W-A-Arrow |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2016 05:02 PM |
| @Saliance, because I forgot about its existence. I usually have used Data Persistance. Data storage is more useful for what I need, so I will use that instead. |
|
|
| Report Abuse |
|
|