Advertisement
Er1x_Official

advanced flame pillar local script

Jan 30th, 2022
1,184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. local control = script.Parent -- gui
  2. local mouse = game:GetService("Players").LocalPlayer:GetMouse() -- mouse
  3. local remote = control:WaitForChild("DAMNFIRE") -- remote event
  4. local uis = game:GetService("UserInputService") -- input service (detect key pressed)
  5. local holding = false
  6.  
  7. uis.InputBegan:Connect(function(i,x) -- uis keypressed function
  8.     if not x then -- check if player is not typing in chat or in a gui
  9.         if i.KeyCode == Enum.KeyCode.F then -- check if the player has pressed the button
  10.             holding = true
  11.             remote:FireServer("FBSTART")
  12.            
  13.             while true do
  14.                 if holding then
  15.                     remote:FireServer("FBHOLDING")
  16.                 else
  17.                     break
  18.                 end
  19.                
  20.                 task.wait()
  21.             end
  22.         elseif i.KeyCode == Enum.KeyCode.G then
  23.             if not holding then
  24.                 remote:FireServer("FPFIRE",mouse.Hit.Position)
  25.             end
  26.         end
  27.     end
  28. end)
  29.  
  30. uis.InputEnded:Connect(function(i,x)
  31.     if not x then
  32.         if i.KeyCode == Enum.KeyCode.F then
  33.             task.wait(.1)
  34.             holding = false
  35.             remote:FireServer("FBFIRE",mouse.Hit.Position)
  36.         end
  37.     end
  38. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement