Hello. I have the following script
local gui = script.Gui
local gui2 = script.Gui2
local domClickedEvent = game.ReplicatedStorage.Events.DominusClicked
local Tool = game.Players.LocalPlayer.Backpack:FindFirstChild("Dynamite")
domClickedEvent.OnClientEvent:Connect(function()
if Tool then
print("its good")
gui2.Enabled = true
game.Players.LocalPlayer.Backpack.Dynamite:Destroy()
wait(8)
game.Workspace.Boulders:Destroy()
else
gui.Enabled = true
game.Players.LocalPlayer.PlayerGui.Dominus.NextClicked.Enabled = true
end
end)
Basically this should happen - the script should check if the player has the tool named "Dynamite". If the player does then it makes gui2 appear, if not then gui should appear. gui keeps on appearing everytime, even though the player has Dynamite in their backpack. The Dynamite is not held when this is done, and this is a localscript located in startergui.
This is the script that triggers the event if it helps.
local clickDetector = script.Parent
local domClickedEvent = game.ReplicatedStorage.Events.DominusClicked
local debounce = false
clickDetector.MouseClick:Connect(function(player)
if not debounce then
debounce = true
domClickedEvent:FireClient(player)
print(player.Name.. "has clicked the brick")
wait(1)
debounce = false
end
end)
I do not know why the script is unable to detect the tool, any help would be appreciated.
Thank you.

2 comments
Hey, I would like to help you, but I can't read your script. Can you please show ALL of your script in code lines?
Sorry, all done.