Insert a RemoteEvent in your ReplicatedStorage.
Insert a Script in your ReplicatedStorage.
Script:
local remoteevent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
local function onserverevent (player)
local dust = Instance.new('Smoke')
dust.Parent = script.Parent.Brush
dust.Color = Color3.fromRGB(199, 172, 120)
dust.Size = 0.5
dust.Opacity = 0.5
dust.RiseVelocity = 0.5
wait(2)
dust:Destroy()
end
remoteevent.OnServerEvent:Connect(onserverevent)
Local Script:
local remoteevent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
script.Parent.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
remoteevent:FireServer()
end)
end)
You can place the remote event and script inside a tool, but not inside a StarterGUI. If you do change it, don't forget to change the variables for the remoteevent.
1 comment
For the regular script you forgot about the fact that you need to click in order for it to function. I'm still having trouble fixing this. Do you know how to accomplish this?