i’m trying to create a script for a tool that will till soil (Like in Islands or similar games), however i’ve had no luck in getting anything to work. My attempt at writing it is here:
local tool = script.Parent
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
tool.Activated:Connect(function()
local target = mouse.Target
if target and target:IsA("BasePart") then
if target.Name == "GrassBlock" then
target.Transparency = 1
end
end
end)
Is there a way to make a block change its transparency (or be modified in any way) when clicked on with a tool? Please let me know
i’ve spent 3 hours on a tool that wasn’t working until i found out i forgot to wrap the while loop in task.spawn().
the server script wasn’t receiving a OnServerEvent() because the while loop was preventing from listening the remote.
OR you’re doing just what you should be doing to learn how to master programming. You’re not going to make these mistakes again because you had to struggle for them. You don’t forget those lessons.