It's a pickaxe tool I'm working on. It seems to work in Play solo, but not in the actual online mode.

Here's the local script for the tool:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse() --Getting the player's mouse
local del=false

	
local selection = Instance.new("SelectionBox", player.PlayerGui)
selection.Color = BrickColor.new("Forest green")

local gui=script.PickaxeGui:clone()
	

script.Parent.Equipped:connect(function()
	del=true
	gui.Parent=player.PlayerGui
end)

script.Parent.Unequipped:connect(function()
	del=false
	gui.Parent=nil
end)

mouse.Move:connect(function() --When the mouse moves
	
		if mouse.Target.Name=="MineBlock" and del==true then
		selection.Adornee=mouse.Target
		
		else selection.Adornee=nil
	end
	
end)


script.Parent.Activated:connect(function()
	
	if mouse.Target.Name=="MineBlock" and  del==true then
		mouse.Target.hit.Value=mouse.Target.hit.Value+1
	end

end)



3 comments

0

Are you using FilteringEnabled? Check to see if FilteringEnabled is set to true in workspace.

0

Filtering Enabled is not enabled.

0

Put this on the top. function waitForChild(parent, childName) local child = parent:FindFirstChild(childName) if child then return child end while true do child = parent.ChildAdded:wait() if child.Name==childName then return child end end end