Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago

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)

0
Clone is not an event, also you should not be storing parts / models in Lighting use Replicated Storage User#5423 17 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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.

Ad

Answer this question