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.
Ok, so I think your problem is that you are using "LocalPlayer" in a server script. I can't really get a good view of your problem, so can you edit your question to also have the client script? I will be able to extend this answer and help you more if I see the localscript aswell.