Advertisement
lafur

my first local script?

Mar 22nd, 2019
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. --Created by PenguinAnonymous (ttyyuu12345) Editied by Dittoide
  2. --What's Added To M2S with Dittoide's Edit?
  3. --/ Better dummy script function to improve compatibility (makes it like you are running the code inside the script.)
  4. --/ Removed Gui In Bottom-Left for when you are making guis.
  5. --/ Removed "Inserting Map Please Wait" gui when selected Workspace as Place to export.
  6. --Credit: PenguinAnonymous for making original script, i just wanted to iron it out to my liking.
  7. --Errors:
  8. local runDummyScript = function(f,scri)
  9. if (not scri:IsA('Script')) or (not scri:IsA('LocalScript')) then return false; end;
  10. local Dummy_CoRoutine = coroutine.create(function()
  11. getfenv().script = scri
  12. ypcall(function() f() end)
  13. end)
  14. table.insert(cors,Dummy_CoRoutine);
  15. coroutine.resume(Dummy_CoRoutine);
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. mas.Name = "M2S_Model"
  20. o1 = Instance.new("Tool")
  21. o2 = Instance.new("Part")
  22. o3 = Instance.new("Script")
  23. o4 = Instance.new("Decal")
  24. o5 = Instance.new("LocalScript")
  25. o1.Parent = mas
  26. o2.Name = "Handle"
  27. o2.Parent = o1
  28. o2.Material = Enum.Material.Neon
  29. o2.BrickColor = BrickColor.new("Really red")
  30. o2.Position = Vector3.new(-16, 0.500001013, 5)
  31. o2.Shape = Enum.PartType.Ball
  32. o2.Size = Vector3.new(4, 4, 4)
  33. o2.CFrame = CFrame.new(-16, 0.500001013, 5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  34. o2.BottomSurface = Enum.SurfaceType.Smooth
  35. o2.TopSurface = Enum.SurfaceType.Smooth
  36. o2.Color = Color3.new(1, 0, 0)
  37. o2.Position = Vector3.new(-16, 0.500001013, 5)
  38. o3.Name = "Damage Script"
  39. o3.Parent = o2
  40.  
  41. runDummyScript(function()
  42. -- useless comment
  43.  
  44. function onTouched(hit)
  45. if not hit or not hit.Parent then return end
  46. local human = hit.Parent:findFirstChild("Humanoid")
  47. if human and human:IsA("Humanoid") then
  48. human:TakeDamage(20)
  49. end
  50. end
  51.  
  52. script.Parent.Touched:connect(onTouched)
  53. end,o3)
  54.  
  55. o4.Name = "fist "
  56. o4.Parent = o2
  57. o4.Texture = "http://www.roblox.com/asset/?id=60056142"
  58. o4.Face = Enum.NormalId.Top
  59. o5.Parent = o1
  60.  
  61. runDummyScript(function()
  62. tool = script.Parent
  63. player = game.Player.LocalPlayer
  64.  
  65. tool.Activated:connect(function)
  66. function onTouched(hit)
  67. if not hit or not hit.Parent then return end
  68. local human = hit.Parent:findFirstChild("Humanoid")
  69. if human and human:IsA("Humanoid") then
  70. human:TakeDamage(20)
  71. end
  72. end
  73.  
  74. script.Parent.Touched:connect(onTouched)
  75. end)
  76. end,o5)
  77.  
  78. mas.Parent = workspace
  79. mas:MakeJoints()
  80. local mas1 = mas:GetChildren()
  81. for i=1,#mas1 do
  82. mas1[i].Parent = game:GetService("Players").LocalPlayer.Backpack
  83. ypcall(function() mas1[i]:MakeJoints() end)
  84. end
  85. mas:Destroy()
  86. for i=1,#cors do
  87. coroutine.resume(cors[i])
  88. end
  89.  
  90. game:GetService("Lighting").Ambient = Color3.new(0, 0, 0)
  91. game:GetService("Lighting").Brightness = 2
  92. game:GetService("Lighting").ColorShift_Bottom = Color3.new(0, 0, 0)
  93. game:GetService("Lighting").ColorShift_Top = Color3.new(0, 0, 0)
  94. game:GetService("Lighting").GlobalShadows = true
  95. game:GetService("Lighting").OutdoorAmbient = Color3.new(0.501961, 0.501961, 0.501961)
  96. game:GetService("Lighting").Outlines = false
  97. game:GetService("Lighting").GeographicLatitude = 41.733299255371
  98. game:GetService("Lighting").TimeOfDay = "14:00:00"
  99. game:GetService("Lighting").FogColor = Color3.new(0.752941, 0.752941, 0.752941)
  100. game:GetService("Lighting").FogEnd = 100000
  101. game:GetService("Lighting").FogStart = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement