Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _G.olm = getsenv(game.Players.LocalPlayer.PlayerScripts.CharacterScript)["loadmap"]
- print("saved old loadmap(), replacing...")
- for i,v in pairs(getsenv(game.Players.LocalPlayer.PlayerScripts.CharacterScript)) do
- getfenv(0)[i] = getsenv(game.Players.LocalPlayer.PlayerScripts.CharacterScript)[i] end
- getsenv(game.Players.LocalPlayer.PlayerScripts.CharacterScript)["loadmap"] = newcclosure(function(map)
- _G.loading = true
- rf.mapdebris:ClearAllChildren()
- map.Parent = workspace
- onrope, pole = nil,nil
- ignore = {char, vis, workspace.debris, button, textbox, snapshotcam}
- rg3 = {}
- spinCF = {}
- enemies = {}
- eggs = 0
- maxeggs = 8
- gotice = false
- UI.UI.egg.Visible = false
- script.bgm:Stop()script.bgmW:Stop()script.bgmA:Stop()script.bgmC:Stop()
- script.bgm.SoundId = "rbxassetid://"..map.settings.bgm.Value
- script.bgmW.SoundId = map.settings:FindFirstChild'bgmW' and "rbxassetid://"..map.settings.bgmW.Value or "rbxasset://sounds/uuhhh.mp3"
- script.bgmA.SoundId = map.settings:FindFirstChild'bgmA' and "rbxassetid://"..map.settings.bgmA.Value or "rbxasset://sounds/uuhhh.mp3"
- script.bgmC.SoundId = map.settings:FindFirstChild'bgmC' and "rbxassetid://"..map.settings.bgmC.Value or "rbxasset://sounds/uuhhh.mp3"
- script.bgmP.SoundId = map.settings:FindFirstChild'bgmP' and "rbxassetid://"..map.settings.bgmP.Value or "rbxasset://sounds/uuhhh.mp3"
- script.bgm.Volume,script.bgmW.Volume,script.bgmA.Volume,script.bgmC.Volume=0,0,0,0
- local toload = {}
- if map:FindFirstChild'spawn'then map.spawn:Destroy() end
- while map:FindFirstChild'GROUP'do
- local g = map.GROUP
- for _,v in pairs(g:GetChildren())do
- v.Parent = map
- end
- g:Destroy()
- end
- for _,v in pairs(map:GetChildren())do
- if v.Name == "water" then
- rg3[#rg3+1]=v
- if v:FindFirstChild'pos'then
- v.pos.Value = v.CFrame
- else
- local g = v:Clone()
- g.Parent = v
- g.Name = "notwater"
- g.Size = v.Size-Vector3.new(1,1,1)*.2
- g.Transparency = 1
- local x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22 = v.CFrame:components()
- g.CFrame = CFrame.new(x, y, z, -R00, R01, R02, -R10, R11, R12, -R20, R21, R22)
- end
- elseif v.Name == "candy"then
- local c = rf.candy:Clone()
- c.Parent = map
- c.CFrame = CFrame.new(v.Position)
- c.pos.Value = v.Position
- spinCF[#spinCF+1] = c
- rg3[#rg3+1]=c
- v:Destroy()
- elseif v.Name == "candy2"then
- for x = 1, 6 do
- local c = rf.candy:Clone()
- c.Parent = map
- c.CFrame = CFrame.new((v.CFrame*CFrame.Angles(0,x/6*math.pi*2,0)*CFrame.new(0,0,-v.Size.X)).p)
- c.pos.Value = c.Position
- spinCF[#spinCF+1] = c
- rg3[#rg3+1]=c
- end
- v:Destroy()
- elseif v.Name == "hcandy"then
- local c = rf.hcandy:Clone()
- c.Parent = map
- c.CFrame = CFrame.new(v.Position)
- c.pos.Value = v.Position
- spinCF[#spinCF+1] = c
- rg3[#rg3+1]=c
- v:Destroy()
- elseif v.Name == "egg"then
- local c = rf.egg:Clone()
- c.Parent = map
- c.CFrame = CFrame.new(v.Position)
- c.pos.Value = v.Position
- spinCF[#spinCF+1] = c
- rg3[#rg3+1]=c
- v:Destroy()
- elseif v.Name == "battery"then
- local c = rf.battery:Clone()
- c.Parent = map
- c.CFrame = CFrame.new(v.Position)
- c.pos.Value = v.Position
- spinCF[#spinCF+1] = c
- rg3[#rg3+1]=c
- v:Destroy()
- elseif v.Name == "jetpack"or v.Name == "skateboard"or v.Name == "flamethrower" then
- v.vis.pos.Value = v.Position
- spinCF[#spinCF+1] = v.vis
- elseif string.sub(v.Name,1,5)=="ToCam"or v.Name == "Light"or string.sub(v.Name, 1,3)=="TPa" or v:FindFirstChild'tx'
- or v.Name=="lava" or v.Name=="breakable"then
- rg3[#rg3+1]=v
- elseif v.Name == "ropemod"then
- torope(true, v)
- elseif v.Name == "enemy"then
- local c = rf.enemies[v.id.Value]:Clone()
- c.Parent = map
- c.col.CFrame = v.CFrame
- enemies[#enemies+1] = {c, require(c.ModuleScript)}
- c.col.tag.Value = #enemies
- rg3[#rg3+1]=c.col
- ignore[#ignore+1] = c
- v:Destroy()
- elseif string.sub(v.Name,1,6)=="unlock"then
- if prog>=tonumber(string.sub(v.Name,7,-1)) then
- v:Destroy()
- end
- elseif v.Name == "door" then
- rg3[#rg3+1]=v
- elseif v.Name == "breakable"then
- rg3[#rg3+1]=v
- elseif v.Name == "icedcream"then
- local c
- if icedfound[v.id.Value] then
- c = rf.notcream:Clone()
- else
- c = rf.icedcream:Clone()
- end
- c.Parent = v.Parent
- c.CFrame = v.CFrame
- c.pos.Value = v.Position
- spinCF[#spinCF+1] = c
- c.desc.Value = v.desc.Value
- c.id.Value = v.id.Value
- v:Destroy()
- elseif v.Name == "silent" then
- rg3[#rg3+1]=v
- elseif v.Name == "wind" then
- rg3[#rg3+1]=v
- end
- end
- if map:FindFirstChild'picks'then
- for _,v in pairs(map.picks:GetChildren())do
- ignore[#ignore+1] = v
- local t = Instance.new("Vector3Value")
- t.Parent = v
- t.Name = "st"
- t.Value = v.Position
- v.CollisionGroupId = 2
- v.Touched:Connect(function(h)
- if h.Name == "kill"then
- v.CFrame = CFrame.new(t.Value)
- v.Velocity = Vector3.new()
- end
- end)
- end
- map.picks.ChildRemoved:connect(function(v)
- wait()
- if map:FindFirstChild'picks' then
- v.Parent = map.picks
- v.CFrame = CFrame.new(v.st.Value)
- v.Velocity = Vector3.new()
- v.RotVelocity = Vector3.new()
- end
- end)
- end
- if map:FindFirstChild'moving' then
- for _,v in pairs(map.moving:GetChildren())do
- if v:FindFirstChild'endo'then
- v.start.Value = v.Position
- v.endo.Value = v.Position + v.endo.Value
- if v.Name == "water"then
- rg3[#rg3+1]=v
- end
- elseif v:FindFirstChild("start")then
- v.start.Value = v.Position
- end
- end
- end
- for _,v in pairs(game.Lighting:GetChildren())do
- if v.Name=="copy"then
- v:Destroy()
- end
- end
- for _,v in pairs(map.settings.lighting:GetChildren())do
- if v.Name=="copy"then
- v.Parent = game.Lighting
- else
- game.Lighting[v.Name] = v.Value
- end
- end
- wait()
- game.ContentProvider:PreloadAsync(toload)
- script.bgm:Play()script.bgmW:Play()script.bgmA:Play()script.bgmC:Play()script.bgmP:Play()
- _G.loading = false
- end)
- print("Replaced loadmap()")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement