Advertisement
DerekLuciano

Scripts para crear un juego de Piggy - Parte 2

Jul 20th, 2021 (edited)
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. local ReplicatedStorage = game:WaitForChild("ReplicatedStorage")
  2. local RemoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents")
  3. local WaitingFrame = script.Parent
  4.  
  5. RemoteEvents.AddWaitingPlayer.OnClientEvent:Connect(function(plr)
  6. local frame = game:WaitForChild("ReplicatedFirst"):WaitForChild("WaitingPlayerFrame"):Clone()
  7. frame.Name = plr.UserId
  8. frame.Parent = WaitingFrame.PlayersFrame
  9. frame.PlayerName.Text = plr.Name
  10. frame.PlayerImage.Image = game.Players:GetUserThumbnailAsync(plr.UserId,Enum.ThumbnailType.HeadShot,Enum.ThumbnailSize.Size420x420)
  11. end)
  12. RemoteEvents.RemoveWaitingPlayer.OnClientEvent:Connect(function(plr)
  13. local frame = WaitingFrame.PlayersFrame:FindFirstChild(plr.UserId)
  14. if frame then
  15. frame:Destroy()
  16. end
  17. end)
  18. ---------------------------------------------------------------------------------------------------------------------------
  19. local ReplicatedStorage = game:WaitForChild("ReplicatedStorage")
  20. local RemoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents")
  21.  
  22. RemoteEvents.AddWaitingPlayer.OnServerEvent:Connect(function(plr)
  23. RemoteEvents.AddWaitingPlayer:FireAllClients(plr)
  24. end)
  25. RemoteEvents.RemoveWaitingPlayer.OnServerEvent:Connect(function(plr)
  26. RemoteEvents.RemoveWaitingPlayer:FireAllClients(plr)
  27. end)
  28. ---------------------------------------------------------------------------------------------------------------------------
  29. local ReplicatedStorage = game:WaitForChild("ReplicatedStorage")
  30. local RemoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents")
  31. local TweenService = game:GetService("TweenService")
  32. local Menu = workspace:WaitForChild("CamaraMenu")
  33. repeat Camara = workspace.CurrentCamera
  34.  
  35. until Camara == workspace.CurrentCamera
  36.  
  37. function CamaraPosicion(Posicion,TweenTime)
  38. TweenService:Create(Camara,TweenInfo.new(TweenTime,Enum.EasingStyle.Linear),{CFrame = Posicion}):Play()
  39. end
  40. local Play = script.Parent
  41. local Back = script.Parent.Parent.BackMenu
  42. local WaitingFrame = script.Parent.Parent.WaitingFrame
  43.  
  44. Play.MouseButton1Click:Connect(function()
  45. Play.Visible = false
  46. Play.Parent.Shop.Visible = false
  47. Play.Parent.Titulo.Visible = false
  48.  
  49. CamaraPosicion(Menu.CamaraPart2,1)
  50. wait(1)
  51. Back.Visible = true
  52. WaitingFrame.Visible = true
  53. RemoteEvents.AddWaitingPlayer:FireServer()
  54. end)
  55. ---------------------------------------------------------------------------------------------------------------------------
  56. local ReplicatedStorage = game:WaitForChild("ReplicatedStorage")
  57. local RemoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents")
  58. local TweenService = game:GetService("TweenService")
  59. local Menu = workspace:WaitForChild("CamaraMenu")
  60. repeat Camara = workspace.CurrentCamera
  61.  
  62. until Camara == workspace.CurrentCamera
  63.  
  64. function CamaraPosicion(Posicion,TweenTime)
  65. TweenService:Create(Camara,TweenInfo.new(TweenTime,Enum.EasingStyle.Linear),{CFrame = Posicion.CFrame}):Play()
  66. end
  67. local Play = script.Parent.Parent.Play
  68. local Shop = script.Parent.Parent.Shop
  69. local Back = script.Parent
  70. local WaitingFrame = script.Parent.Parent.WaitingFrame
  71.  
  72. Back.MouseButton1Click:Connect(function()
  73. Back.Visible = false
  74. WaitingFrame.Visible = false
  75. RemoteEvents.RemoveWaitingPlayer:FireServer()
  76. CamaraPosicion(Menu.CamaraPart,1)
  77. wait(1)
  78. Play.Visible = true
  79. Shop.Visible = true
  80. Back.Parent.Titulo.Visible = true
  81. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement