So, This script is to morph a playermodel into a custom model with custom animations 'n' such, Which goes like this:
01 | local morph = game.ReplicatedStorage.Puro --Replace with path to desired Morph |
02 | local pad = script.Parent |
03 |
04 | pad.Touched:connect( function (hit) |
05 | local par = hit.Parent |
06 | if par.ClassName = = "Model" then |
07 | local transfured = par:FindFirstChildWhichIsA( "BoolValue" ) |
08 | if transfured.value = = false then |
09 | local hum = par:FindFirstChild( "Humanoid" ) |
10 | if hum then |
11 | local ply = game.Players:GetPlayerFromCharacter(par) |
12 | if ply then |
13 | local morphClone = morph:Clone() |
14 | morphClone.Name = par.Name |
15 | morphClone.Parent = game.Workspace |
The thing is; After the character morphs, 3 seconds later, The character respawns, What I assume that happens is that the model switch makes the game think that the character has died, And is soon going to respawn it.
So, Uh, The question is: How do I stop this? It's just the ONLY thing that doesn't let my morph script to work.
in the touched event do this at the end of it
01 | hum.Died:Connect( function () |
02 | wait( 3 ) |
03 | local morphClone = morph:Clone() |
04 | morphClone.Name = par.Name |
05 | morphClone.Parent = game.Workspace |
06 | morphClone.PrimaryPart.CFrame = par.PrimaryPart.CFrame |
07 | ply.Character = morphClone |
08 | wait( 0.5 ) |
09 | local Animator = morphClone:FindFirstChild( "Animator" ) |
10 | Animator.Disabled = false |
11 | local Dyez = morphClone:FindFirstChild( "CommitDyez" ) |
12 | Dyez.Disabled = false |
13 | game.Workspace.EVENTS [ "AnimationChange (Puro)" ] :FireClient(hit) |
14 |
15 | end ) |
01 | local morph = game.ReplicatedStorage.Puro --Replace with path to desired Morph |
02 | local pad = script.Parent |
03 |
04 | pad.Touched:connect( function (hit) |
05 | local par = hit.Parent |
06 | if par.ClassName = = "Model" then |
07 | local transfured = par:FindFirstChildWhichIsA( "BoolValue" ) |
08 | if transfured.value = = false then |
09 | local hum = par:FindFirstChild( "Humanoid" ) |
10 | if hum then |
11 | local ply = game.Players:GetPlayerFromCharacter(par) |
12 | if ply then |
13 | local morphClone = morph:Clone() |
14 | morphClone.Name = par.Name |
15 | morphClone.Parent = game.Workspace |