SHOW:
|
|
- or go back to the newest paste.
1 | --Created by PenguinAnonymous (ttyyuu12345) Editied by Dittoide | |
2 | - | --Converted with ttyyuu12345's model to script plugin v4 |
2 | + | --What's Added To M2S with Dittoide's Edit? |
3 | - | function sandbox(var,func) |
3 | + | --/ Better dummy script function to improve compatibility (makes it like you are running the code inside the script.) |
4 | - | local env = getfenv(func) |
4 | + | --/ Removed Gui In Bottom-Left for when you are making guis. |
5 | - | local newenv = setmetatable({},{ |
5 | + | --/ Removed "Inserting Map Please Wait" gui when selected Workspace as Place to export. |
6 | - | __index = function(self,k) |
6 | + | --Credit: PenguinAnonymous for making original script, i just wanted to iron it out to my liking. |
7 | - | if k=="script" then |
7 | + | --Errors: UnionOperation,TouchTransmitter,Camera |
8 | - | return var |
8 | + | local runDummyScript = function(f,scri) |
9 | - | else |
9 | + | if (not scri:IsA('Script')) or (not scri:IsA('LocalScript')) then return false; end; |
10 | - | return env[k] |
10 | + | local Dummy_CoRoutine = coroutine.create(function() |
11 | - | end |
11 | + | getfenv().script = scri |
12 | - | end, |
12 | + | ypcall(function() f() end) |
13 | - | }) |
13 | + | end) |
14 | - | setfenv(func,newenv) |
14 | + | table.insert(cors,Dummy_CoRoutine); |
15 | - | return func |
15 | + | coroutine.resume(Dummy_CoRoutine); |
16 | end | |
17 | cors = {} | |
18 | - | mas = Instance.new("Model",game:GetService("Lighting")) |
18 | + | mas = Instance.new("Model",game:GetService("Lighting")) |
19 | - | Tool0 = Instance.new("Tool") |
19 | + | mas.Name = "M2S_Model" |
20 | - | Part1 = Instance.new("Part") |
20 | + | o1 = Instance.new("Tool") |
21 | - | SpecialMesh2 = Instance.new("SpecialMesh") |
21 | + | o2 = Instance.new("NumberValue") |
22 | - | LocalScript3 = Instance.new("LocalScript") |
22 | + | o5 = Instance.new("LocalScript") |
23 | - | LocalScript4 = Instance.new("LocalScript") |
23 | + | o7 = Instance.new("ScreenGui") |
24 | - | Animation5 = Instance.new("Animation") |
24 | + | o8 = Instance.new("TextBox") |
25 | - | Camera6 = Instance.new("Camera") |
25 | + | o9 = Instance.new("TextButton") |
26 | - | Sound7 = Instance.new("Sound") |
26 | + | o1.Name = "Portal gun" |
27 | - | Tool0.Name = "Mackerel" |
27 | + | o1.Parent = mas |
28 | - | Tool0.Parent = mas |
28 | + | o1.GripPos = Vector3.new(0, -0.366941452, 0.803922653) |
29 | - | Tool0.TextureId = "http://www.roblox.com/asset/?id= 46156602 " |
29 | + | o2.Name = "Val" |
30 | - | Tool0.Grip = CFrame.new(0, -2, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0) |
30 | + | o2.Parent = o1 |
31 | - | Tool0.GripForward = Vector3.new(-1, 0, -0) |
31 | + | o2.Value = 32990482 |
32 | - | Tool0.GripPos = Vector3.new(0, -2, 0) |
32 | + | o5.Parent = o1 |
33 | - | Tool0.GripRight = Vector3.new(0, 0, -1) |
33 | + | |
34 | - | Part1.Name = "Handle" |
34 | + | runDummyScript(function() |
35 | - | Part1.Parent = Tool0 |
35 | + | portal = false |
36 | - | Part1.CFrame = CFrame.new(-2.09999847, 0.245092556, 4.36993933, -6.44848842e-06, -0.99999994, -5.96046448e-08, -1, 6.52701419e-06, -0.000248211581, 0.000248180353, 2.98023224e-08, -0.99999994) |
36 | + | dimension = false |
37 | - | Part1.Orientation = Vector3.new(0.00999999978, -180, -90) |
37 | + | appear = false |
38 | - | Part1.Position = Vector3.new(-2.09999847, 0.245092556, 4.36993933) |
38 | + | the = script.Parent.Val.Value |
39 | - | Part1.Rotation = Vector3.new(179.98999, 0, 90) |
39 | + | |
40 | - | Part1.Color = Color3.new(0.388235, 0.372549, 0.384314) |
40 | + | function wormhole() |
41 | - | Part1.Transparency = 1 |
41 | + | local c = script.Parent.ScreenGui:Clone() |
42 | - | Part1.Size = Vector3.new(0.490000129, 0.200000003, 0.740000129) |
42 | + | c.Parent = game.Players.LocalPlayer.PlayerGui |
43 | - | Part1.BottomSurface = Enum.SurfaceType.Smooth |
43 | + | c.TextButton.MouseButton1Click:connect(function() |
44 | - | Part1.BrickColor = BrickColor.new("Dark stone grey") |
44 | + | script.Parent.Val.Value = c.TextBox.Text |
45 | - | Part1.Reflectance = 0.40000000596046 |
45 | + | local wormhole = Instance.new("Part") |
46 | - | Part1.TopSurface = Enum.SurfaceType.Smooth |
46 | + | wormhole.Size = Vector3.new(5,5,0.2) |
47 | - | Part1.brickColor = BrickColor.new("Dark stone grey") |
47 | + | wormhole.Name = "Hole" |
48 | - | Part1.FormFactor = Enum.FormFactor.Custom |
48 | + | wormhole.Parent = game.Workspace |
49 | - | Part1.formFactor = Enum.FormFactor.Custom |
49 | + | wormhole.CFrame = script.Parent.Handle.CFrame |
50 | - | SpecialMesh2.Parent = Part1 |
50 | + | wormhole.BrickColor = BrickColor.new("Lime green") |
51 | - | SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=46140354" |
51 | + | wormhole.Anchored = true |
52 | - | SpecialMesh2.Scale = Vector3.new(0.800000012, 0.699999988, 0.699999988) |
52 | + | wormhole.CanCollide = false |
53 | - | SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=46140461" |
53 | + | local click = Instance.new("ClickDetector") |
54 | - | SpecialMesh2.MeshType = Enum.MeshType.FileMesh |
54 | + | click.Parent = game.Workspace.Hole |
55 | - | LocalScript3.Name = "Mackerel" |
55 | + | click.MouseClick:connect(function(player) |
56 | - | LocalScript3.Parent = Tool0 |
56 | + | game:GetService("TeleportService"):Teleport(script.Parent.Val.Value,player) |
57 | - | table.insert(cors,sandbox(LocalScript3,function() |
57 | + | |
58 | - | -- Mackerel -- |
58 | + | wait(5) |
59 | - | -- Whack Animation, time 0.5 seconds |
59 | + | wormhole:remove() |
60 | - | -- Whack Sound, 0.4 seconds |
60 | + | |
61 | end | |
62 | - | -- Handle to the game service, in case we need to get the time |
62 | + | script.Parent.Equipped:connect(wormhole) |
63 | - | r = game:service("RunService") |
63 | + | function remove() |
64 | game.Players.LocalPlayer.PlayerGui.ScreenGui:remove() | |
65 | - | -- normal damage, when the Mackerel touches a humanoid object |
65 | + | |
66 | - | local damage = 5 |
66 | + | script.Parent.Unequipped:connect(remove) |
67 | end,o5) | |
68 | - | -- Whack damage |
68 | + | |
69 | - | local whack_damage = 8 |
69 | + | o7.Parent = o1 |
70 | o8.Parent = o7 | |
71 | - | -- Handle to tool |
71 | + | o8.Position = UDim2.new(0,159,0,170) |
72 | - | Mackerel = script.Parent.Handle |
72 | + | o8.Size = UDim2.new(0,205,0,50) |
73 | - | Tool = script.Parent |
73 | + | o8.Text = "Please put the id on this from game" |
74 | o8.position = UDim2.new(0,159,0,170) | |
75 | - | -- For the Animations |
75 | + | o8.Position = UDim2.new(0,159,0,170) |
76 | - | local WhackAnim |
76 | + | o8.BackgroundColor3 = Color3.new(0.192157, 0.890196, 0.447059) |
77 | o8.BorderColor3 = Color3.new(0.341176, 0.207843, 1) | |
78 | o8.BorderSizePixel = 5 | |
79 | - | -- Sounds! |
79 | + | o8.Font = Enum.Font.Highway |
80 | - | local MackerelWhack = Tool:FindFirstChild("FishWhack") |
80 | + | o8.FontSize = Enum.FontSize.Size14 |
81 | - | if MackerelWhack == nil then |
81 | + | o8.TextColor3 = Color3.new(1, 0.988235, 0.643137) |
82 | - | MackerelWhack = Instance.new("Sound") |
82 | + | o8.TextStrokeColor3 = Color3.new(1, 1, 0.0941177) |
83 | - | MackerelWhack.Name = "FishWhack" |
83 | + | o9.Parent = o7 |
84 | - | MackerelWhack.SoundId = "http://www.roblox.com/asset/?id=46153268" |
84 | + | o9.Position = UDim2.new(0,159,0.10000000149012,179) |
85 | - | MackerelWhack.Parent = Tool |
85 | + | o9.Size = UDim2.new(0,208,0,25) |
86 | - | MackerelWhack.Volume = 1 |
86 | + | o9.Text = "Click to confirm!" |
87 | o9.position = UDim2.new(0,159,0.10000000149012,179) | |
88 | o9.Position = UDim2.new(0,159,0.10000000149012,179) | |
89 | - | -- When a collision is detected between the player and another character |
89 | + | o9.BackgroundColor3 = Color3.new(0.258824, 1, 0.129412) |
90 | - | function blow(hit) |
90 | + | o9.Font = Enum.Font.SourceSansSemibold |
91 | - | if hit == nil or hit.Parent == nil then return end |
91 | + | o9.FontSize = Enum.FontSize.Size14 |
92 | - | local opponent = hit.Parent:findFirstChild("Torso") |
92 | + | o9.TextColor3 = Color3.new(0.952941, 1, 0.054902) |
93 | - | local humanoid = hit.Parent:findFirstChild("Humanoid") |
93 | + | mas.Parent = workspace |
94 | - | local vCharacter = Tool.Parent |
94 | + | mas:MakeJoints() |
95 | - | local vPlayer = game.Players:playerFromCharacter(vCharacter) |
95 | + | local mas1 = mas:GetChildren() |
96 | - | local myTorso = vCharacter:findFirstChild("Torso") |
96 | + | for i=1,#mas1 do |
97 | - | local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character |
97 | + | mas1[i].Parent = game:GetService("Players").LocalPlayer.Backpack |
98 | - | if humanoid~=nil and humanoid ~= hum and hum ~= nil then |
98 | + | ypcall(function() mas1[i]:MakeJoints() end) |
99 | - | -- final check, make sure Mackerel is in-hand |
99 | + | |
100 | - | local right_arm = vCharacter:FindFirstChild("Right Arm") |
100 | + | |
101 | - | if (right_arm ~= nil) then |
101 | + | for i=1,#cors do |
102 | - | local joint = right_arm:FindFirstChild("RightGrip") |
102 | + | coroutine.resume(cors[i]) |
103 | - | if (joint ~= nil and (joint.Part0 == Mackerel or joint.Part1 == Mackerel)) then |
103 | + |