Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer;
- local mouse = player:GetMouse();
- local Damage = 10;
- local Usable = false;
- local WaitTime = 5;
- local IsEquipped = false;
- local Tool = script.Parent;
- Tool.Unequipped:Connect(function()
- IsEquipped = false
- end)
- Tool.Equipped:Connect(function()
- IsEquipped = true;
- end)
- mouse.Button1Down:Connect(function()
- if IsEquipped == true then
- if game.Players.LocalPlayer:DistanceFromCharacter(mouse.Target.Position) < 5 and not Usable and IsEquipped then
- Usable = true;
- local EventRemote = mouse.Target.Parent:FindFirstChild("RemoteEvent");
- if EventRemote ~= nil and mouse.Target.Name == "Tronco" then
- EventRemote:FireServer(game.Players.LocalPlayer, Damage);
- end
- else
- print ("Por favor obten una distancia mas cerca");
- end
- wait(WaitTime);
- Usable = false;
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement