I am currently trying to script a tool so when you click on a part with it equipped, it prints something. But otherwise, if you click it when it is not equipped, I want nothing to print.
Local script in tool
local player = game.Players.LocalPlayer
local tool = script.Parent
Set = game.ReplicatedFirst.Set
local Target = game.Workspace.Block
tool.Equipped:Connect(function(mouse)
mouse.Button1Down:Connect(function()
if mouse.Target and mouse.Target.Parent then
end
end)
end)
tool.Activated:Connect(function()
Set:FireServer(Target, tool)
end)
player.MouseButton1Click:Connect(function()
Set:FireServer(Target, tool)
end)
Script in tool
local player = game.Players.LocalPlayer
local tool = script.Parent
Set = game.ReplicatedFirst.Set
local Target = game.Workspace.Block
Set.OnServerEvent:Connect(function(player, Target, tool)
if Target == "Block" and tool.Eqquiped == true then
print ("stuff happens")
end
end)
By the way, ReplicatedFirst is not meant to store remotes. You have confused it with ReplicatedStorage. The former is meant for LocalScripts, whereas the latter is meant for replicating contents between the server and client.