Hello there, I wanted to make a LocalScript where if a player clicks a part, the part is destroyed and another event sequentially occurs (Which is updating the text of the TextLabel named value), however even though it looks correct to me what I expected to happen did not happened, here is the script
NOTE: The reason why there is a WaitForChild in the script is that the book is inside a ReplicatedStorage where it will only be placed in Workspace when a certain event happens
local user = game:GetService("Players").LocalPlayer
local book = game.Workspace:WaitForChild("Book")
local bookclick = book.ClickDetector
local value = user.PlayerGui.BackGui.Value
bookclick.MouseClick:Connect(function()
book.LocalScript.Parent:Destroy()
value.Text += 1
end)

2 comments
AIN'T NO WAY MY MIND DID NOT PROCESS THE MOST BASIC THING IN SCRIPT LINE WHICH IS "SCRIPT.PARENT" , anyway yeah it worked now after replacing the line with script.Parent thank you
Oh okay, I just re-edited the post because I thought the mistake is in different place now :D. I am glad it worked. If you want I made here server side script which could be used if you wanted to change the mechanics on server side, you are welcome :D.