TwoSide3Point0

mario 64 camera mode

Mar 18th, 2022
976
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.49 KB | None | 0 0
  1. function sandbox(var,func)
  2.     local env = getfenv(func)
  3.     local newenv = setmetatable({},{
  4.         __index = function(self,k)
  5.             if k=="script" then
  6.                 return var
  7.             else
  8.                 return env[k]
  9.             end
  10.         end,
  11.     })
  12.     setfenv(func,newenv)
  13.     return func
  14. end
  15. cors = {}
  16. mas = Instance.new("Model",game:GetService("Lighting"))
  17. Camera0 = Instance.new("Camera")
  18. LocalScript1 = Instance.new("LocalScript")
  19. Camera0.Parent = mas
  20. Camera0.CFrame = CFrame.new(37.9769249, 30.075201, 19.3000088, -0.565168023, -0.426261216, 0.706319034, -0, 0.856169343, 0.51669544, -0.824975789, 0.292019755, -0.483879536)
  21. Camera0.CoordinateFrame = CFrame.new(37.9769249, 30.075201, 19.3000088, -0.565168023, -0.426261216, 0.706319034, -0, 0.856169343, 0.51669544, -0.824975789, 0.292019755, -0.483879536)
  22. Camera0.Focus = CFrame.new(36.5642853, 29.0418091, 20.2677689, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  23. Camera0.focus = CFrame.new(36.5642853, 29.0418091, 20.2677689, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  24. LocalScript1.Name = "amera"
  25. LocalScript1.Parent = mas
  26. table.insert(cors,sandbox(LocalScript1,function()
  27. local v1 = Instance.new("Part", script.Parent);
  28. v1.Name = "am";
  29. v1.Size = Vector3.new(0.1, 0.1, 0.1);
  30. v1.CanCollide = false;
  31. v1.Transparency = 1;
  32. v1.Position = game:GetService("Players").LocalPlayer.Character.Head.Position;
  33. local v2 = Instance.new("BodyPosition", v1);
  34. v2.P = 50000;
  35. v2.MaxForce = Vector3.new(500000, 500000, 500000);
  36. workspace.CurrentCamera.CameraSubject = v1;
  37. local u1 = game:GetService("Players").LocalPlayer.Character;
  38. local u2 = 0;
  39. local function u3(p1, p2)
  40.     local v3 = Instance.new("Model");
  41.     Instance.new("Part", v3).Position = p1;
  42.     Instance.new("Part", v3).Position = p2;
  43.     game:GetService("Debris"):AddItem(v3, 0.1);
  44.     return v3:GetBoundingBox().p;
  45. end;
  46. game:GetService("RunService").Heartbeat:Connect(function()
  47.     u1 = game:GetService("Players").LocalPlayer.Character;
  48.     workspace.CurrentCamera.CameraSubject = v1;
  49.     if u1.Humanoid:GetState() ~= Enum.HumanoidStateType.Freefall or u1.HumanoidRootPart.Anchored == true then
  50.         v2.Position = u1.Head.Position;
  51.         u2 = u1.Head.Position.Y;
  52.         return;
  53.     end;
  54.     v2.Position = u3(Vector3.new(u1.Head.Position.X, u2, u1.Head.Position.Z), u1.Head.Position);
  55.     if select(2, workspace.CurrentCamera:WorldToViewportPoint(u1.Head.Position)) == false then
  56.         u2 = u1.Head.Position.Y;
  57.     end;
  58. end);
  59.  
  60. end))
  61. for i,v in pairs(mas:GetChildren()) do
  62.     v.Parent = workspace
  63.     pcall(function() v:MakeJoints() end)
  64. end
  65. mas:Destroy()
  66. for i,v in pairs(cors) do
  67.     spawn(function()
  68.         pcall(v)
  69.     end)
  70. end
  71.  
Advertisement
Add Comment
Please, Sign In to add comment