Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can someone tell me why my cloned item keeps coming back nil?

Okay, so basically I've been trying to clone the player.Character in a server script, but it keeps saying "attempt to index local 'Astral' (a nil value)" even though Its not a nil value. Does anyone know whats happening?

local PrueFire = game.ReplicatedStorage.Prue


PrueFire.OnServerEvent:Connect(function(Player,Spell,Misc)
	
	
	if Spell == "Astral" then

	local Char = Player.Character
		if Char then
		local Astral = Char:Clone()
		Astral.Parent = workspace
		end
		
	end
	
	
	
	
	
	
	
end)






1 comment

0

I have been playing around with it for 30 minutes, but I cant get it to work.

1 answer

✓ Accepted answer

This question was previously answered here, you need to set the Archivable property of Character to true

local PrueFire = game.ReplicatedStorage.Prue


PrueFire.OnServerEvent:Connect(function(Player,Spell,Misc)

	if Spell == "Astral" then

		local Char = Player.Character
		if Char then
			Char.Archivable = true
			local Astral = Char:Clone()
			Astral.Parent = workspace
		end
	end
end)

2 comments

0

Thank you so much!

0

No problem

This discussion is preserved as it was. New answers, comments, and votes are closed.