Hi, I need some help with my script I am still a beginner
script.Parent.MouseButton1Click:Connect(function() script.Parent.Visible = false script.Parent:FindFirstChild("ForceField"):Destroy() end)
I know somethings missing but I don't know what is it
and my button is
Button > ScreenGui > Starter Gui
I also tried doing
script.Parent.Parent.Parent:FindFirstChild
too but it doesn't work
I already figured it out
player = game.Players.LocalPlayer script.Parent.MouseButton1Click:Connect(function() script.Parent.Visible = false player.Character:FindFirstChild("ForceField") player.Character.ForceField:remove() end)
I should've used player.Character instead of script.Parent