Help with StarterCharacter scripts

  1. What do you want to achieve? I want it so that the startercharacter scripts load but its not loading for some reason
  2. What is the issue? idk how to fix it and im not allowed to run/low health animation with this dev skin
  3. What solutions have you tried so far? i put the startercharacter scripts in the character skin but it doesnt work
game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		if plr.UserId == 178196501 then
			local mm = plr.Character
			local as = mm.Animate:Clone()
			local devskin = game.ReplicatedStorage.Hank:Clone()
			devskin.Parent = workspace
			devskin:MoveTo(char.PrimaryPart.Position)
			plr.Character = devskin
			mm.Archivable = true
			mm:Destroy()
			as.Parent = devskin
		end
	end)
end)
1 Like

So, here’s the thing

The PlayerAdded event will only fire if there’s a valid player in the game, but since you placed it inside StarterCharacterScripts which would place that script as soon as a Character is added into the game, yeaah that’s why

If you don’t know what I mean:

  • The PlayerAdded event won’t be able to run first, as it’s waiting for the Character to properly load first when you placed it inside StarterCharacterScripts

Just reference that script inside ServerScriptService instead and it should work

the stuff in startercharacterscripts or the script i put in this topic? because i put the script in this topic in serverscriptservice already

Well, what kind of script is it exactly? A Server or Local?

If server, it should work fine if you place it there

If it’s Local, you’d need to change up your script a bit to possibly something like this:

local Player = game.Players.LocalPlayer
local Character = script.Parent

if Player.UserId == 178196501 then
    local AS = Character.Animate:Clone()
    local DevSkin = game.ReplicatedStorage.Rank:Clone()
    DevSkin.Parent = workspace
    DevSkin:MoveTo(Character.PrimaryPart.Position)

    Character = Devskin
    Character.Archivable = true

    AS.Parent = DevSkin
    Character:Destroy() --Wait why the heck are you doing this
end
1 Like

Ive made it a serverscript but it doesnt let me sprint/low health animation since the startercharacterscripts arent loading into the devskin/morph

Wait

Since it’s a Model, couldn’t you just call MakeJoints() after you clone it, and after parenting it to the workspace?

Im really not a scripter so I really dont understand?

I meant this:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		if plr.UserId == 178196501 then
			local mm = plr.Character
			local as = mm.Animate:Clone()
			local devskin = game.ReplicatedStorage.Hank:Clone()
			devskin.Parent = workspace
            devskin:MakeJoints()
			devskin:MoveTo(char.PrimaryPart.Position)
			plr.Character = devskin
			mm.Archivable = true
			mm:Destroy()
			as.Parent = devskin
		end
	end)
end)

Since you’re cloning a model & it has Joints, I believe you’ll have to call the MakeJoints() function in order to properly weld everything you need, otherwise it’d just break apart & not work right

1 Like

your script works but it doesnt put startercharacterscripts scripts into the model like it doesnt load the scripts in startercharacterscripts into my skin

1 Like

Are you talking about the Animate script? Not sure I follow

nonoonon the animate script works fine its just that i need all of THESE scripts in the skin but it doesnt go in it for example the sprint script aka doesnt make me sprint
Screen Shot 2021-07-04 at 5.10.26 PM

That’s a lot of scripts

I believe you could just simply loop through everything inside StarterCharacterScripts, and clone everything from there onto the new Character (Or what Hank is supposed to be)

Not sure though, but try this?

local rep = game:GetService("ReplicatedStorage")
local nametag = rep:WaitForChild("NameTag")


game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		if plr.UserId == 178196501 then
			local mm = plr.Character
			local as = mm.Animate:Clone()
			local devskin = game.ReplicatedStorage.Hank:Clone()
			devskin.Parent = workspace
			devskin:MakeJoints()
			devskin:MoveTo(char.PrimaryPart.Position)
			plr.Character = devskin
			mm.Archivable = true
			mm:Destroy()
			as.Parent = devskin
			
			for _, Script in pairs(game.StarterPlayer.StarterCharacterScripts:GetChildren()) do
				local ScriptClone = Script:Clone()
				ScriptClone.Parent = devskin
			end
		end
	end)
end)

Screen Shot 2021-07-04 at 5.16.48 PM
Hank from madness combat11!11!! tiky11!!1

anyways

what exactly is nametag? also for some reason its not spawning…

Oh, my bad I included that in a different script I forgot to remove

This should work

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		if plr.UserId == 178196501 then
			local mm = plr.Character
			local as = mm.Animate:Clone()
			local devskin = game.ReplicatedStorage.Hank:Clone()
			devskin.Parent = workspace
			devskin:MakeJoints()
			devskin:MoveTo(char.PrimaryPart.Position)
			plr.Character = devskin
			mm.Archivable = true
			mm:Destroy()
			as.Parent = devskin
			
			for _, Script in pairs(game.StarterPlayer.StarterCharacterScripts:GetChildren()) do
				local ScriptClone = Script:Clone()
				ScriptClone.Parent = devskin
			end
		end
	end)
end)
1 Like

IT WORKS!!! dude I’ve been trying to do this for like 3 hours or something omg11!!1!1!
I am so happy but anyways thanks for helping! I’ll give creditos to you in game in description and maybe a name tag or reference idkk

1 Like

jsut asking but how do i make it so i respawn as my character…

It depends entirely on what you want to do with that

You could just a ClickDetector so that it only changes your Character whenever you click on the object, cause the script you currently have would change your Character every time you respawn (Unless if you only want it to happen once)

no im talking off topic like how do i make my skin respawn since i doesnt really respawn after i die maybe related to the script idk

Oh I see

Provided you have a Humanoid inside your Custom Character, try this?

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		if plr.UserId == 178196501 then
			local mm = plr.Character
			local as = mm.Animate:Clone()
			local devskin = game.ReplicatedStorage.Hank:Clone()
			devskin.Parent = workspace
			devskin:MakeJoints()
			devskin:MoveTo(char.PrimaryPart.Position)
			plr.Character = devskin
			mm.Archivable = true
			mm:Destroy()
			as.Parent = devskin
			
            devskin:WaitForChild("Humanoid").Died:Connect(function()
                wait(5)
                plr:LoadCharacter()
            end)

			for _, Script in pairs(game.StarterPlayer.StarterCharacterScripts:GetChildren()) do
				local ScriptClone = Script:Clone()
				ScriptClone.Parent = devskin
			end
		end
	end)
end)
1 Like

The Camera tho and humanoid yield for some reason??, also sorry for answering late