My click detector script, isn't working, can someone help?
local function playerWhoClicked(player) print('player who clicked is ' .. player.Name) local p = player.PlayerGui.Inventory.main.container.Wood.Wood.HowMany if script.Parent.Parent.Enabled.Value == false then if p.Value > 0 then p.Value = p.Value - 1 local clone = game.Lighting.Planks:Clone() clone.Parent = workspace script.Parent.Parent.Enabled.Value = true else player.PlayerGui.O.Enabled = true wait(1.5) player.PlayerGui.O.Enabled = false end else player.PlayerGui.N.Enabled = true wait(1.5) player.PlayerGui.N.Enabled = false end end script.Parent.MouseClick:Connect(playerWhoClicked)
Code^
I also have this script to work with the click detector.
function onClicked(Player) local Wood = Player.PlayerGui.Inventory.main.container.Wood.Wood.HowMany script.Parent.MouseButton1Click:connect(function() if script.Parent.Enabled.Value == false then --if Wood.Value == 0 then -- Wood.Value = Wood.Value - 0 local Planks = game.Lighting.Planks:Clone() Planks.Parent = workspace Planks.Position = game.Lighting.Planks.Position end --end end) end