Help with script

why are default animations not playing??

here are the scripts

LocalScript

local SetSubject = game.ReplicatedStorage:WaitForChild("setSubject")

function onEvent_SetSubject(Humanoid)
	workspace.CurrentCamera.CameraSubject = Humanoid
end

SetSubject.OnClientEvent:Connect(onEvent_SetSubject)

and here’s the other

Normal script

local Player = script.Parent.Parent.Parent
local Content = script.Parent.mainFrame.ScrollingFrame
local Characters = game.ReplicatedStorage.characters
local SetSubject = Characters.Parent.setSubject

for index,item in pairs(Characters:GetChildren()) do
	if item:FindFirstChild("Humanoid") then
		local ViewportFrame = Instance.new("ViewportFrame")
		ViewportFrame.Parent = Content
		ViewportFrame.BackgroundTransparency = 1

		local Button = Instance.new("TextButton")
		Button.Parent = ViewportFrame
		Button.Position = UDim2.new(0,0,1,0)
		Button.Size = UDim2.new(1,0,0,15)
		Button.BorderSizePixel = 0
		Button.BackgroundColor3 = Color3.fromRGB(255,255,255)
		Button.Text = "Spawn"
		Button.TextScaled = true

		local Preview = item:Clone()
		Preview.Parent = ViewportFrame

		local Camera = Instance.new("Camera")
		Camera.Parent = ViewportFrame
		Camera.CFrame = Preview.Head.CFrame + Preview.Head.CFrame.LookVector * 5
		Camera.CFrame = CFrame.new(Camera.CFrame.Position,Preview.Head.Position)

		ViewportFrame.CurrentCamera = Camera

		Button.MouseButton1Down:Connect(function()
			script.Parent.Enabled = false
			local ChosenCharacter = item:Clone()
			local CurrentCharacter = Player.Character
			local LocalScripts = {}

			for index2,item2 in pairs(game.StarterPlayer.StarterCharacterScripts:GetChildren()) do
				if item2:IsA('LocalScript') then
					table.insert(LocalScripts,item2:Clone())
				else
					item2:Clone().Parent = ChosenCharacter
				end
			end

			CurrentCharacter.Health:Clone().Parent = ChosenCharacter
			table.insert(LocalScripts,CurrentCharacter.Animate:Clone())		
			ChosenCharacter.Parent = workspace
			Player.Character = ChosenCharacter
			for index2,item2 in pairs(LocalScripts) do
				item2.Parent = ChosenCharacter
			end	
			SetSubject:FireClient(Player,ChosenCharacter.Humanoid)

			local Connection

			local function onDied()
				wait(game.Players.RespawnTime)
				Player:LoadCharacter()
				script.Parent.Enabled = true
				if Connection then
					Connection:Disconnect()
				end
			end

			Connection = ChosenCharacter.Humanoid.Died:Connect(onDied)

		end)

	end
end

Any help would be appreciated!!

2 Likes

Are inside those models have the “Animate” script from ROBLOX?

1 Like

no there is not I custom-made them from normal r6

Yes. For those starter models or starter character, try adding the “Animate” script from ROBLOX. So when they spawned, they can have the animation.


here’s an example

try adding the “Animate” script from ROBLOX

where can I get that???

please any help would be great thx

Run blank game, look up for your character in explorer, get the Animate script

Did you add the Animation script for the Characters?
You can do that by Playing the game in studio, Then going to your character and Copy the Animate script

the script up there clones the animate script and puts it in the custom character but it’s not working

the script up there clones the animate script and puts it in the custom character but it’s not working

Don’t clone it from the script.

That’s how you do it…
(chars)

@lilmazen1234

here
if I do it manually the animations they already bought or smth won’t show up

only default animation will show up

You have Custom animations???
If so make a Script for the Custom animation then paste it into all the characters

Can you try run a test of your game in roblox, not in studio, and tell me if there is a delay between movement

no the animations that they already have like they bought or smth

the character GUI doesn’t even show up in-game help plzz