Joriangames

WIND TUTORIAL BLOXIANCODE

Jun 15th, 2023
722
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. -- WIND TUTORIAL BY BLOXIANCODE youtube.com/c/BloxianCode
  2. -- Tutorial: https://youtu.be/mfB5LEZpTH8
  3.  
  4. local canTouch = true --decides if the player can touch the part and let it change the wind
  5.  
  6. script.Parent.Touched:Connect(function(hit) --function fires when something or someone hit the part/brick
  7.     if hit.Parent:FindFirstChild("Humanoid") then --if it was a player who hit, then we continue
  8.         if canTouch == true then --we check if the canTouch value is true. If it is, which means the function can be fired..
  9.             canTouch = false --we set the canTouch value to false
  10.             workspace.GlobalWind = Vector3.new(100,0,0) --we change the wind direction and speed to 100 in the x-direction
  11.             wait(5)
  12.             workspace.GlobalWind = Vector3.new(0,20,0) --we change the wind direction and speed to 20 in the y-direction
  13.             wait(5)
  14.         end
  15.     end
  16. end)
Advertisement
Add Comment
Please, Sign In to add comment