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

Clone event isnt working, but in other script it worked, what is wrong?

the function :clone() in my script isnt working, but only he

function Click(mouse)
	script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.stats[script.Parent.Name].Value = script.Parent.Parent.Name
	wait(0.1)
	script.Parent.Parent.Parent.Parent.ResultSkill1.Text = script.Parent.Parent.Name
	script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.SkillBar1:ClearAllChildren()
 --wroking well
	local Skill = game.Lighting.AkumaNoMi.GomuGomuNoMi.GomuGomuNoMi.Pistol.GomuGomuNoPistol:Clone() -- stop working here
	Skill = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.SkillBar1
	local SkillOff = game.Lighting.SkillInterior.SkillOff:Clone()
	SkillOff = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.SkillBar1
	local SkillOffPermanently = game.Lighting.SkillOffPermanently:Clone()
	SkillOffPermanently = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.SkillBar1
	script.Parent.Parent.Slot1.Visible = false
	script.Parent.Parent.Slot2.Visible = false
	script.Parent.Parent.Slot3.Visible = false
	script.Parent.Parent.Slot4.Visible = false
	
end


script.Parent.MouseButton1Down:connect(Click)

1 comment

0

Clone is not an event, also you should not be storing parts / models in Lighting use Replicated Storage

1 answer

✓ Accepted answer

You need to declare the parents of the clones.

local SkillOff = game.Lighting.SkillInterior.SkillOff:Clone()
SkillOff.Parent = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.SkillBar1

SkillOffPermanently = game.Lighting.SkillOffPermanently:Clone()
SkillOffPermanently.Parent = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.SkillBar1

Add .Parent to the objects after you've cloned them.

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