Clone doesn't exist?

Put it in playerscripts. It’s better for you. Nobody really wants multiple radios :sweat_smile:

Unfortunately…
image

The error below probably means the RadioUI is nil or the Player is nil, did you remember making Player a variable?

Is the new luau thing on for you? I heard there might be some bugs with that, try turning it off and see what happens.

Edit: OH I think I know what’s going on. Clone it on a seperate line and it should work!

Player is a variable and I have tested it and when RadioUI is cloned, it’s nil but when it’s not cloned, it’s perfectly fine.

1 Like

RadioUI must be getting destroyed when it’s created. Have anything that blocks instances
being added into PlayerGui?

I got it to work with the same exact code (except I added a player variable) and no errors, RadioUI.rbxl (20.1 KB) there’s the place if you want to check it out.

2 Likes

If I just clone it, it doesn’t show up in the replicatedStorage.
image

local Lighting = game.Lighting
local Player = game.Players.LocalPlayer

Lighting.Ambient = Color3.fromRGB(10, 10, 10)
Lighting.SCP008Effect.Enabled = false
Lighting.SCP0492Effect.Enabled = false
Lighting.SCP059Effect.Enabled = false
Lighting.NightVision.Enabled = false
if game.Players.LocalPlayer.PlayerGui:FindFirstChild("Ambient") then
	game.Players.LocalPlayer.PlayerGui:FindFirstChild("Ambient"):Destroy()
end

print("Spawn actions completed.")

wait(3)

if Player.Team ~= game.Teams["Class-D"] and Player.Team ~= game.Teams["Class-E"] and not Player.PlayerGui:FindFirstChild("Radio") and Player.PlayerGui:FindFirstChild("Menu").Music.Volume == 0 then

	local RadioUI = game:GetService("ReplicatedStorage"):WaitForChild("Radio")
	RadioUI:Clone()
--	RadioUI.Parent = Player.PlayerGui
--	RadioUI.Frame:TweenPosition(UDim2.new(1, -230, 1, -115),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.5)
	if Player.Team == game.Teams["Chaos Insurgency"] then
		RadioUI.Frame.Raid.Visible = true
	else
		RadioUI.Frame.Main.Visible = true
	end
	
end


if not Player.PlayerGui:FindFirstChild("GunUI") then

local GunUI = game.ReplicatedStorage.GunUI:Clone()
GunUI.Parent = Player.PlayerGui

end

script:Destroy()

This is the whole script if that changes anything.

What I meant was define a variable for the original GUI, then define another variable as a clone of it, then parent it to the player’s PlayerGui.

I tried that before and it didn’t work sadly. Same error. For some reason it’s not letting the client clone it?

Remove the script:Destroy() line and see what occurs.

Nothing different unfortunately.

Yeah… Might as well post this in Engine bugs because I feel dumb trying to solve something so simple :joy:

Can you try
RadioUI:Clone().Parent = path

1 Like

I used the same exact code, and it worked for me.
If you didn’t notice the post earlier, click here to go to the post.

Ok basically I’m going to take a different approach of putting it in PlayerGui since this is really annoying.

1 Like

Oh, my ReplicatedStorage has Archivable off. Could that be the reason?

1 Like

:L
Yeah, most-likely. If something has Archivable ticked off it can’t be accessed. There’s your problem fix, maybe.

Yes, I reproduced your situation and Radio disappears when ReplicatedStorage.Archivable is set to false.

edit: why does archivable even exist