Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a dig tool that only works on specific objects not baseplate?

Asked by 2 years ago

I want to make a tool that makes a object thats beneath the human get smaller each time the tool is clicked. The point is that theres a map and you have to dig sand to find a key. The tool only works on the specific sand not anything else so that you cant dig out the map.

1 answer

Log in to vote
0
Answered by 2 years ago

So I wont give you all the code, but I can teach you how to solve this problem * I'm not giving the code because this seems a lot like a request.

So basically you want to detect what the mouse is clicking at.

local MouseFocus = game.Players.LocalPlayer:GetMouse().Target

you must put this in a local script.

this code basically gets the player's mouse and sees which is the target.

if MouseFocus == Sand then
    Sand.Size = Sand.Size/2

To be honest, i dont remember what is division in roblox LUA so check that out

now this code sees that if the block clicked is sand then it will divide the sand's size by 2 or any other magnitude you want.

Hope this Helps!

Any questions? Just ask!

Ad

Answer this question