How to turn my player character into an Npc character?

Delete the animation script you just added. And do this:

LocalScript
game.Workspace.CurrentCamera.CameraSubject = script.Parent:WaitForChild("Humanoid")
pcall(function()
	script.Parent:WaitForChild("Animate").Disabled = true
	script.Parent:WaitForChild("Animate").Disabled = false
end)
Script
local prompt = script.Parent

prompt.TriggerEnded:Connect(function(player)

	print(player)

	local gamePassId = 22080195 -- Gamepass ID here

	local userId = player.userId

	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(userId,gamePassId) == false then

		print("Player Does Not Have Gamepass")

		game:GetService("MarketplaceService"):PromptGamePassPurchase(player, gamePassId)

	else

		print("Player Has Gamepass")

		local character = player.Character
		character.Archivable = true

		local clone = character:Clone()

		clone:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(character:WaitForChild("HumanoidRootPart").Position)

		local newcharLocation = game:GetService("ServerStorage").KitClones.NoobKit

		local newchar = newcharLocation:Clone()

		newchar.Parent = workspace

		newchar.Name = player.Name

		player.Character = newchar

		player.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(clone:WaitForChild("HumanoidRootPart").Position)
		player.Character:WaitForChild("HumanoidRootPart").Anchored = false
		local LS = script:WaitForChild("LocalScript"):Clone()
		LS.Parent = player.Character
		LS.Disabled = false
	end

end)

If it doesnā€™t work, then re-add the animation script, and try again.

1 Like

Nope, animation still doesnt work. My noob character is just sstanding straight ;-;

for npc, the simple method is you need to convert animate localscript to server script
also remove emotes code inside it. :sweat_smile:

1 Like

Replace the Animate script with this: Animate.rbxm (6.5 KB)

To add: Right click NPC character > Insert from fileā€¦

Also:

LocalScript
game.Workspace.CurrentCamera.CameraSubject = script.Parent:WaitForChild("Humanoid")
1 Like

Can you show me an example of what you mean? I donā€™t really understand :confused:

I already converted to server script, in my last post.

Butā€¦
To convert to server script, you would just copy the source of the LocalScript and paste it into a server script.

It really depends on what you are trying to do with a script. For example, you would have to find a Player, instead of using game.Players.LocalPlayer because itā€™s not a LocalScript.

1 Like

alright cool. you save me from explaining :slightly_smiling_face: :sweat_smile:

1 Like

This still does not work, my character still does not have any animation :pensive:

Just follow these instructions instead.

After converting, change the original server script to:

Script
local prompt = script.Parent

prompt.TriggerEnded:Connect(function(player)

	print(player)

	local gamePassId = 22080195 -- Gamepass ID here

	local userId = player.userId

	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(userId,gamePassId) == false then

		print("Player Does Not Have Gamepass")

		game:GetService("MarketplaceService"):PromptGamePassPurchase(player, gamePassId)

	else

		print("Player Has Gamepass")

		local character = player.Character
		character.Archivable = true

		local clone = character:Clone()

		clone:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(character:WaitForChild("HumanoidRootPart").Position)

		local newcharLocation = game:GetService("ServerStorage").KitClones.NoobKit

		local newchar = newcharLocation:Clone()

		newchar.Parent = workspace

		newchar.Name = player.Name

		player.Character = newchar

		player.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(clone:WaitForChild("HumanoidRootPart").Position)
		player.Character:WaitForChild("HumanoidRootPart").Anchored = false
		local LS = script:WaitForChild("LocalScript"):Clone()
		LS.Parent = player.Character
		LS.Disabled = false
		pcall(function()
			player.Character.Animate.Disabled = true
			player.Character.Animate.Disabled = false
		end)
	end

end)

If youā€™re all confused and stuff:

Just do that and then, change the proximity prompt script:

Script
local prompt = script.Parent

prompt.TriggerEnded:Connect(function(player)

	print(player)

	local gamePassId = 22080195 -- Gamepass ID here

	local userId = player.userId

	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(userId,gamePassId) == false then

		print("Player Does Not Have Gamepass")

		game:GetService("MarketplaceService"):PromptGamePassPurchase(player, gamePassId)

	else

		print("Player Has Gamepass")

		local character = player.Character
		character.Archivable = true

		local clone = character:Clone()

		clone:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(character:WaitForChild("HumanoidRootPart").Position)

		local newcharLocation = game:GetService("ServerStorage").KitClones.NoobKit

		local newchar = newcharLocation:Clone()

		newchar.Parent = workspace

		newchar.Name = player.Name

		player.Character = newchar

		player.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(clone:WaitForChild("HumanoidRootPart").Position)
		player.Character:WaitForChild("HumanoidRootPart").Anchored = false
		local LS = script:WaitForChild("LocalScript"):Clone()
		LS.Parent = player.Character
		LS.Disabled = false
		pcall(function()
			player.Character.Animate.Disabled = true
			player.Character.Animate.Disabled = false
		end)
	end

end)
1 Like

Okay so my character has animation now, but the animation is delayed. For example, if I hold W, the animation will only start after about 0.5 seconds. If I tap W very quickly, my character moves, but no animationā€¦

I edited the post, check out the part after the lineā€¦

1 Like

wait, i though you want to animate an npc without any player controllinng it. my mistake, use localscript instead :sweat_smile:

1 Like

no animation if i change the animate script to a localscript

now, i know the reason. after look at the animate script.
it is because the script is for R6 not R15

2 Likes

Oh. Okā€¦

Replace the animate script with this: AnimateLocal.rbxm (6.7 KB)

Do this:

LocalScript << Remember inside of the proximity script
game.Workspace.CurrentCamera.CameraSubject = script.Parent:WaitForChild("Humanoid")
pcall(function()
	script.Parent:WaitForChild("Animate").Disabled = true
	script.Parent:WaitForChild("Animate").Disabled = false
end)
Proximity Script
local prompt = script.Parent

prompt.TriggerEnded:Connect(function(player)

	print(player)

	local gamePassId = 22080195 -- Gamepass ID here

	local userId = player.userId

	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(userId,gamePassId) == false then

		print("Player Does Not Have Gamepass")

		game:GetService("MarketplaceService"):PromptGamePassPurchase(player, gamePassId)

	else

		print("Player Has Gamepass")

		local character = player.Character
		character.Archivable = true

		local clone = character:Clone()

		clone:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(character:WaitForChild("HumanoidRootPart").Position)

		local newcharLocation = game:GetService("ServerStorage").KitClones.NoobKit

		local newchar = newcharLocation:Clone()

		newchar.Parent = workspace

		newchar.Name = player.Name

		player.Character = newchar

		player.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(clone:WaitForChild("HumanoidRootPart").Position)
		player.Character:WaitForChild("HumanoidRootPart").Anchored = false
		local LS = script:WaitForChild("LocalScript"):Clone()
		LS.Parent = player.Character
		LS.Disabled = false
	end

end)

[EDIT: I ACCIDENTALLY PUT THE WRONG FILE, SO IF IT DIDNā€™T WORK TRY TO DOWNLOAD AGAIN]

2 Likes

@incognitobot_rblx I said to change avatar type to R6 from the beginningā€¦

2 Likes

also im getting an error:
Workspace.Probloxed123.Animate:739: attempt to index nil with 'Chatted'

the animate script im using is:
Animate.rbxm (9.8 KB)
its for R15

1 Like

why me :sweat_smile:
forgive me :sweat_smile:

2 Likes

I accidentally put the wrong script, if you didnā€™t already noticeā€¦
So try again if didnā€™t work: AnimateLocal.rbxm (6.7 KB)

2 Likes

you need to remove emote code script

2 Likes