i cant find the error, im trying to make when click in the gui if StringValue is GomuGomuNoMi clone the gui in lighting and put in starterGui.hotbar.SkillBar1 and if there are something in skill bar 1 that dont is called SkillOff or SkillOffPermanently he will put the gui in skill bar 2, and the same thing in 2, 3 and 4, but i cant find the error
function Click(mouse)
if script.Parent.Parent.Parent.Parent.stats.AkumaNoMi.Value = GomuGomuNoMi then
game.Lighting.GomuGomuNoPistol:clone() = script.Parent.Parent.SkillBar1
end
end
script.Parent.MouseButton1Down:connect(Click)
what is wrong?
(SOLVED)
i re-created the script, and now it works, look
Plr = game.Players.LocalPlayer
script.Parent.MouseButton1Down:connect(function()
for _,v in pairs(Plr.PlayerGui:GetChildren()) do
if v.Name == script.Parent.Name then
v:Destroy()
end
end
if game.Players.LocalPlayer.stats.AkumaNoMi.Value == "GomuGomuNoMi" then
Tool = game.Lighting.GomuGomuNoPistol:Clone()
Tool.Parent = Plr.PlayerGui.Hotbar.SkillBar1
end
end)

1 comment
Instead of just typing GomuGomuNoMi, surround it in quotes since it is a string like "GomuGomuNoMi".