Universal Script 📌
2.0k Views
10 Executions

ViewportCharacterSync

Universal Script 📌
2 years ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Just playing around with cameraviewport

View Raw
local p=game:GetService("Players")  
local r=game:GetService("RunService")  
local lp=p.LocalPlayer  
local cam=workspace.CurrentCamera  
local rs,gui,vpf  

local function stop()  
if rs then rs:Disconnect()rs=nil end  
if gui then gui:Destroy()gui,vpf=nil,nil end  
end  

local function init()  
if not lp.Character then return end  
local c=lp.Character  
local hrp=c:FindFirstChild("HumanoidRootPart")or c:WaitForChild("HumanoidRootPart",5)  
if not hrp then return end  
c.Archivable=true  
local clone=c:Clone()  
local hrpClone=clone:FindFirstChild("HumanoidRootPart")  

for _,v in ipairs(c:GetDescendants())do if v:IsA("BasePart")or v:IsA("Decal")then v.Transparency=1 end end  
if hrpClone then hrpClone.Transparency=1 end  
stop()  

gui=Instance.new("ScreenGui")  
gui.IgnoreGuiInset=true  
gui.Parent=game:GetService("CoreGui")  

vpf=Instance.new("ViewportFrame")  
vpf.Size=UDim2.new(1,0,1,0)  
vpf.BackgroundTransparency=1  
vpf.CurrentCamera=cam  
vpf.Parent=gui  
clone.Parent=vpf  

c.DescendantRemoving:Connect(function(v)  
local cp=clone:FindFirstChild(v.Name,true)  
if cp then cp:Destroy()end  
end)  



Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all