Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Something did this and unexpectedly removed this?

Asked by 9 years ago

"Something unexpectedly tried to set the parent of ChunkB1 to NULL while trying to set the parent of ChunkB1. Current parent is Camera."

--PROXTECH GFX
wait()
--CAN EDIT(Not suggested)

RangeLow = 300 --Ammount of studs a distance can be maximum to load a chunk on Low Render(0)
RangeMedium = 550 -- Rangelow but on Medium Render(1)
RangeHigh = 1300 -- Rangelow but on High Render(2)
FogEnabled = false --Do not touch
FogDistLow = 800 -- The Distance for fogstart(Lowers lagg on some computers)
FogDistHigh = 1200 -- FogDistLow but on Higher fogstart


--CAN EDIT(Not suggested)

--DO NOT EDIT

Plr = game.Players.LocalPlayer
Cam = game.Workspace.CurrentCamera
Rend = script.Render
Map = Plr.PlayerGui:FindFirstChild("MAP")

--DO NOT EDIT


while wait() do --Loop things and stuff
    repeat wait() until Plr.Character:FindFirstChild("Torso") -- Wait until torso exists
    if Map ~= nil then --BEGIN RENDER
        for i,v in pairs(Map:GetChildren()) do --Collect Chunks
            Mag = (v.ChunkPlate.Position - Plr.Character.Torso.Position).magnitude
            if Rend.Value == 0 then
                script.RenderDist.Value = RangeLow
                if Mag <= RangeLow then
                    v.Parent = Cam
                    CDE = script.ChunkDest:Clone()
                    CDE.Parent = v
                    CDE.RendMax.Value = RangeLow
                    CDE.Player.Value = Plr
                    CDE.Disabled = false
                end
            elseif Rend.Value == 1 then
                script.RenderDist.Value = RangeMedium
                if Mag <= RangeMedium then
                    v.Parent = Cam
                    CDE = script.ChunkDest:Clone()
                    CDE.Parent = v
                    CDE.RendMax.Value = RangeMedium
                    CDE.Player.Value = Plr
                    CDE.Disabled = false
                end
            elseif Rend.Value == 2 then
                script.RenderDist.Value = RangeHigh
                if Mag <= RangeHigh then
                    v.Parent = Cam
                    CDE = script.ChunkDest:Clone()
                    CDE.Parent = v
                    CDE.RendMax.Value = RangeHigh
                    CDE.Player.Value = Plr
                    CDE.Disabled = false
                end
            end
        end
    end
end

This is the only part of the script that does parent this thing only, The rest of the script is unimportant

After it says that message I find the chunks that I tried to load as empty models with only scripts and etc and no parts, This is infact confusing me really bad, I would really like some help

0
According to other solutions it is caused by setting two different parents for one thing at once, That may be the cause for other people, But I only set one parent for this LordProxius 17 — 9y
0
This often happens when something is created and immediately destroyed. Before you destroy something, add a wait(). This may seem like a stupid solution but it solves the problem. jobro13 980 — 9y
0
@jobro I have tried, Did not work LordProxius 17 — 9y

1 answer

Log in to vote
0
Answered by
MrFlimsy 345 Moderation Voter
9 years ago

You'll need to provide more context. What other code do you have running that affects ChunkB1?

0
The code is too valuable to begin with... LordProxius 17 — 9y
0
Chunk B1 is not the only chunk that it is rendering but I have updated the script to include the full script, This better be worth it LordProxius 17 — 9y
0
Which line is the error on? MrFlimsy 345 — 9y
0
Does not say LordProxius 17 — 9y
Ad

Answer this question