I'm currently developing a group place but I have no idea on how to generate random faces (or decals). I have around 10 custom made faces I made specifically for that reason. I only know how to script a single face that appears on death... Can anyone help? Thanks!
I asked for help on the ROBLOX Forums and they ended up with this. Script that didn't work:
01 | local ContentProvider = game:GetService( "ContentProvider" ) |
02 | repeat wait() until game.Players.LocalPlayer.Character ~ = nil |
03 | repeat wait() until (ContentProvider.RequestQueueSize = = 0 ) |
04 |
05 | local Plr = game.Players.LocalPlayer |
06 | local Char = game.Players.LocalPlayer.Character |
07 | while true do |
08 | wait( 0.1 ) |
09 | if script.Parent.Humanoid ~ = nil then |
10 | if script.Parent.Humanoid.Health = = 1 then |
11 | local ChangeFace = true |
12 | local FaceId = { 574701104 , 574701264 , 574701296 , 574701328 , 574701359 , 574701387 , 574701414 , 574701431 , 574701479 , 574701532 } |
13 |
14 | wait( 0.5 ) |
15 |
01 | local ContentProvider = game:GetService( "ContentProvider" ) |
02 | repeat wait() until game.Players.LocalPlayer.Character ~ = nil |
03 | repeat wait() until (ContentProvider.RequestQueueSize = = 0 ) |
04 |
05 | local Plr = game.Players.LocalPlayer |
06 | local Char = game.Players.LocalPlayer.Character |
07 | while true do |
08 | wait( 0.1 ) |
09 | if script.Parent.Humanoid ~ = nil then |
10 | if script.Parent.Humanoid.Health = = 1 then |
11 | local ChangeFace = true |
12 | local FaceId = { 574701104 , 574701264 , 574701296 , 574701328 , 574701359 , 574701387 , 574701414 , 574701431 , 574701479 , 574701532 } |
13 |
14 | wait( 0.5 ) |
15 |
So what I did was remove 'FaceId' at the end of line 17, because it causes an error. Also instead of putting (1, 10) on line 17, you can put (1, #FaceId). #FaceId is the number of all the children inside of the table.
Hope this has helped!