#Player continues to duplicate within ViewportFrame

1 messages · Page 1 of 1 (latest)

echo flare
#
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")

local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid

local GUI = player.PlayerGui.Wardrobe:FindFirstChild("GUI")

local PlayerFrame = GUI:FindFirstChild("PlayerFrame")

local clothingEvent = game.ReplicatedStorage.remoteEvents:FindFirstChild("clothingEvent")

local clonedCharacter

character.Archivable = true

local newCamera = Instance.new("Camera")
newCamera.Parent = PlayerFrame
PlayerFrame.CurrentCamera = newCamera

clonedCharacter = character:Clone()
local humanoidRootPart = clonedCharacter:WaitForChild("HumanoidRootPart")

local debounce = false

function renderPlayer()
    clonedCharacter.Parent = PlayerFrame.WorldModel
    clonedCharacter.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
    clonedCharacter:SetPrimaryPartCFrame(CFrame.new(Vector3.new(0, 0, -1), Vector3.new(0, 0, 0)))
    newCamera.CFrame = CFrame.new(Vector3.new(0, 0, 5), Vector3.new(0, 0, 0))
end

renderPlayer()```
This is my first time using viewport frames, and I decided to render the player's current model within it. But I can now see that for whatever reason they continue to duplicate and stack upon one another. Does anyone have any idea why this may be happening?
slender folio
#

so it duplicates every single time when u respawn character?

echo flare
slender folio
#

where does this script located?

echo flare
slender folio
#

wait so if u just join game and dont respawn character it will clone by itself?

#

I hope u understood what I said, im not english

echo flare
slender folio
#

idk why this happens but we can work around this bug and add 'if' thing

#

like check if the clone already exists

#

like it yk

echo flare
slender folio
#

kk it should works

#

if u need help, write