So Im makeing a game called SkyWars and well the BreakTool works whenever you test it in studio... but it dose't when you save and play the actuial game.

This has happened to me alot... not just in this game.

well heres the script inside my BreakTool.

bin = script.Parent
local pack = bin.Parent
local player = pack.Parent

function onButton1Down(mouse)
	local hit = mouse.Target
	if (hit == nil) then return end
		if (hit.Block ~= nil) then -- dont worry about all this. hit.Block  dose exist (Theres a value called Block in hit)
			
			local block = game.Lighting.PlaceBlock:Clone() -- or about all this
			block.Parent = game.Players.LocalPlayer.Backpack -- or this
			block.Name = ""..hit.Name.."" -- or this. It works.
			
			hit:remove()
		end
	end



function onSelected(mouse)
	print("Action Tool Selected")
	mouse.Icon = "rbxasset://textures\\GunCursor.png"
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

bin.Selected:connect(onSelected)

Thanks for reading!

6 comments

0

Why are you asking us to vote up?

0

Cos hes low on upvotes.

1

You don't upvote just because someone is low on upvotes. People upvote if the question was fair, or spammy, or upvote for whatever reason they feel.

0

so more people can see it. Thats what Vote Ups do right?

0

Is they script a local script? Hopperbins require a local script in order to function and while in studio mode all scripts act like local scripts, so it would explain the problem.

0

oooo