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)
The second line isn't correct. In an if statement you must use two equals signs for it to work. So it would be:
if script.Parent.Parent.Parent.Parent.stats.AkumaNoMi.Value == GomuGomuNoMi then
I highly recommend using output bar so you can see what goes wrong in your script.