Advertisement
Diamond32_Tutoriales

Script Para Talar En Roblox con Eventos Remote

Jun 22nd, 2023
803
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. local player = game.Players.LocalPlayer;
  2. local mouse = player:GetMouse();
  3. local Damage = 10;
  4. local Usable = false;
  5. local WaitTime = 5;
  6. local IsEquipped = false;
  7.  
  8. local Tool = script.Parent;
  9.  
  10. Tool.Unequipped:Connect(function()
  11.     IsEquipped = false
  12. end)
  13.  
  14. Tool.Equipped:Connect(function()
  15.     IsEquipped = true;
  16.  
  17. end)
  18.  
  19.  
  20. mouse.Button1Down:Connect(function()
  21.      if IsEquipped == true then
  22.        
  23.         if game.Players.LocalPlayer:DistanceFromCharacter(mouse.Target.Position) < 5 and not Usable and IsEquipped then
  24.         Usable = true;
  25.         local EventRemote = mouse.Target.Parent:FindFirstChild("RemoteEvent");
  26.  
  27.      if EventRemote ~= nil  and mouse.Target.Name == "Tronco" then
  28.                     EventRemote:FireServer(game.Players.LocalPlayer, Damage);
  29.             end
  30.         else
  31.             print ("Por favor obten una distancia mas cerca");
  32.         end
  33.         wait(WaitTime);
  34.         Usable = false;
  35.     end
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement