Advertisement
axefec

Code abrir puerta Roblox

Sep 5th, 2022
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | Gaming | 0 0
  1. local Can = true
  2.  
  3. local Open = false
  4.  
  5. script.Parent.Event.OnServerEvent:connect(function(Player)
  6.  
  7. local Mag = (script.Parent.Center.Position-Player.Character.HumanoidRootPart.Position).magnitude
  8.  
  9. if Mag <= script.Parent.Range.Value then
  10.  
  11. if Can then
  12.  
  13. Can = false
  14.  
  15. if Open == false then
  16.  
  17. local finish = script.Parent.PrimaryPart.CFrame*CFrame.Angles(0,math.rad(90),0)
  18.  
  19. for i = 0,1,.1 do
  20.  
  21. local cfm = script.Parent.PrimaryPart.CFrame:lerp(finish,i)
  22.  
  23. script.Parent:confounded:etPrimaryPartCFrame(cfm)
  24.  
  25. wait()
  26.  
  27. end
  28.  
  29. Open = true
  30.  
  31. else
  32.  
  33. Open = false
  34.  
  35. local finish = script.Parent.PrimaryPart.CFrame*CFrame.Angles(0,-math.rad(90),0)
  36.  
  37. for i = 0,1,.1 do
  38.  
  39. local cfm = script.Parent.PrimaryPart.CFrame:lerp(finish,i)
  40.  
  41. script.Parent:confounded:etPrimaryPartCFrame(cfm)
  42.  
  43. wait()
  44.  
  45. end
  46.  
  47. end
  48.  
  49. Can = true
  50.  
  51. end
  52.  
  53. end
  54.  
  55. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement