Advertisement
Primal_Dev

Map Script

Oct 3rd, 2022
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.60 KB | None | 0 0
  1. local TweenService = game:GetService("TweenService")
  2.  
  3. local Frame = script.Parent:WaitForChild("MapFrame")
  4. local Image = Frame:WaitForChild("MapImage")
  5. local Name = Frame:WaitForChild("MapName")
  6.  
  7. local MapName = game.ReplicatedStorage.Values:WaitForChild("MapName")
  8. local MapImage = game.ReplicatedStorage.Values:WaitForChild("MapImage")
  9. local MapColor = game.ReplicatedStorage.Values:WaitForChild("MapColor")
  10. local remotes = game.ReplicatedStorage.Remotes
  11.  
  12. local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
  13.  
  14. --- Visible Tween ---
  15.  
  16. local Visible = {}
  17. Visible.Transparency = 0
  18.  
  19. local tweenv = TweenService:Create(Frame, tweenInfo, Visible)
  20.  
  21. --- Invisible Tween ---
  22.  
  23. local Invisible = {}
  24. Invisible.Transparency = 1
  25.  
  26. local tweeni = TweenService:Create(Frame, tweenInfo, Invisible)
  27.  
  28. MapName:GetPropertyChangedSignal("Value"):Connect(function()
  29.     Name.Text = MapName.Value
  30. end)
  31.  
  32. MapImage:GetPropertyChangedSignal("Value"):Connect(function()
  33.     Image.Image = MapImage.Value
  34. end)
  35.  
  36. MapColor:GetPropertyChangedSignal("Value"):Connect(function()
  37.     Frame.BackgroundColor3 = Color3.fromHex(MapColor.Value)
  38. end)
  39.  
  40.  
  41. remotes.Visible.OnClientEvent:Connect(function()
  42.     tweenv:Play()
  43.     Frame.MapName.BackgroundTransparency = 0.7
  44.     task.wait(3)
  45.     Frame:TweenPosition(UDim2.new(0.017,0, 0.374,0))
  46.     Frame:TweenSize(UDim2.new(0.17,0, 0.307,0))
  47. end)
  48.  
  49. remotes.Invisible.OnClientEvent:Connect(function()
  50.     tweeni:Play()
  51.     Frame.MapName.BackgroundTransparency = 1
  52.     task.wait(3)
  53.     Frame:TweenPosition(UDim2.new(0.344,0, 0.293,0))
  54.     Frame:TweenSize(UDim2.new(0.31,0, 0.412,0))
  55. end)
  56.  
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement