SOLVED | Script Failing to work when cloned

Hello I have a script for a 999 Call system then Needs to be cloned to each Call Created in the frame.

The Script works in the original Frame and prints a Message But Fails to open frames once cloned to a different parent

Server Scripts Both:

– Clone Script –

game.Workspace.Fire_Control.Control_Global.Fire_Control.Fire_Call_Remote.OnClientEvent:Connect(function()

local Call = Instance.new("Frame")

Call.Size = UDim2.new(0, 142, 0, 15)

Call.BackgroundColor3 = Color3.new(0, 0.596078, 0.65098)

Call.BorderSizePixel = 1

Call.BorderColor3 = Color3.new(0, 0, 0)

Call.Parent = script.Parent

Call.Name = (game.Workspace.Fire_Control.Control_Global.Fire_Control.Fire_Call_Number_Folder.Value .. "Callout_Number")

local Call_Status = Instance.new("TextLabel")

Call_Status.Position = UDim2.new(-0.6, 0,-1.3, 0)

Call_Status.Size = UDim2.new(0, 200, 0, 50)

Call_Status.BackgroundTransparency = 1

Call_Status.BorderSizePixel = 0

Call_Status.Parent = Call

Call_Status.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Bold)

Call_Status.TextSize = 14

Call_Status.Text = "UAC"

Call_Status.Name = "Callout_Status"

local Call_Type = Instance.new("TextLabel")

Call_Type.Position = UDim2.new(-0.3, 0,-1.3, 0)

Call_Type.Size = UDim2.new(0, 200, 0, 50)

Call_Type.BackgroundTransparency = 1

Call_Type.BorderSizePixel = 0

Call_Type.Parent = Call

Call_Type.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Bold)

Call_Type.TextSize = 14

Call_Type.Text = "A.0.0"

Call_Type.Name = "Call_Type"

local Call_Open = Instance.new("TextButton")

Call_Open.Position = UDim2.new(0.75, 0, 0, 0)

Call_Open.Size = UDim2.new(0, 35, 0, 15)

Call_Open.BackgroundTransparency = 0

Call_Open.BackgroundColor3 = Color3.new(0.4, 1, 0)

Call_Open.Selectable = true

Call_Open.BorderSizePixel = 0

Call_Open.Parent = Call

Call_Open.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Bold)

Call_Open.TextSize = 14

Call_Open.Text = "OPEN"

Call_Open.Name = "Call_Open"

---------------------------

local Callout_Details = Instance.new("Frame")

Callout_Details.Visible = false

Callout_Details.Size = UDim2.new(0, 142, 0, 15)

Callout_Details.BackgroundColor3 = Color3.new(0.705882, 0.705882, 0.705882)

Callout_Details.BackgroundTransparency = 0

Callout_Details.BorderSizePixel = 1

Callout_Details.Parent = script.Parent.Parent.Callouts_Details

Callout_Details.Name = (game.Workspace.Fire_Control.Control_Global.Fire_Control.Fire_Call_Number_Folder.Value .. "Callout_Number_Details")

---------------------------

local Callout_Details_Link = Instance.new("ObjectValue")

Callout_Details_Link.Parent = Call

Callout_Details_Link.Value = Callout_Details

Callout_Details_Link.Name = "Callout_Details_Link_Value"

local Callout_Link = Instance.new("ObjectValue")

Callout_Link.Parent = Call

Callout_Link.Value = Call

Callout_Link.Name = "Callout_Link_Value"

---------------------------

local Callout_Link = Instance.new("ObjectValue")

Callout_Link.Parent = Callout_Details

Callout_Link.Value = Call

Callout_Link.Name = "Callout_Link_Value"

local Callout_Link = Instance.new("ObjectValue")

Callout_Link.Parent = Callout_Details

Callout_Link.Value = Callout_Details

Callout_Link.Name = "Callout_Details_Link_Value"

---------------------------

wait(.1)

local Callout_Details_Frame_Script = script.Parent.Demo_Callout_Number.Call_Open.Callout_Frame_Details:Clone()

Callout_Details_Frame_Script.Parent = Call_Open

---------------------------

end)

The Cloning script is the Last few lines

Blockquote

Script That Fails to open a frame.

 while true do
> 	wait()
> 	script.Parent.MouseButton1Click:Connect(function()
> 		print("Hello")
> 		script.Parent.Parent.Callout_Details_Link_Value.Value.Visible = true
> 		script.Parent.Parent.Callout_Link_Value.Value.Visible = false
> 	end)
> end

Maybe this isn’t your solution but remove the while true! The connection already waits for events to happen you should never :Connect in a loop without disconnecting it.

script.Parent.MouseButton1Click:Connect(function()
	print("Hello")
	script.Parent.Parent.Callout_Details_Link_Value.Value.Visible = true
	script.Parent.Parent.Callout_Link_Value.Value.Visible = false
 end)

I don’t see how you are cloning your other script. Please include the remote event that must fire for the first script to run.

Do you have discord / dizzy by chance if that would be easier to show and video

script.Parent.MouseButton1Click:Connect(function()

print("Hello")

script.Parent.Parent.Callout_Details_Link_Value.Value.Visible = true

script.Parent.Parent.Callout_Link_Value.Value.Visible = false

end)
game.Workspace.Fire_Control.Control_Global.Fire_Control.Fire_Call_Remote.OnClientEvent:Connect(function()

local Callout_Details_Frame_Script = script.Parent.Demo_Callout_Number.Call_Open.Callout_Frame_Details:Clone()

Callout_Details_Frame_Script.Parent = Call_Open
end)

It works just not opening the frame

Discord FoxysFire_Photo#4252

If you have any suggestions then please help as this is a huge issue and adding delays to the funding of the project.

Is there no game.Workspace.Fire_Control.Control_Global.Fire_Control.Fire_Call_Remote:FireClient anywhere? that’s the part I would be looking for. Specifically the FireClient function

> game.Workspace.Fire_Control.Control_Global.Fire_Control.Fire_Call_Remote.OnClientEvent:Connect(function()
> 
> local Call = Instance.new("Frame")
> 
> Call.Size = UDim2.new(0, 142, 0, 15)
> 
> Call.BackgroundColor3 = Color3.new(0, 0.596078, 0.65098)
> 
> Call.BorderSizePixel = 1
> 
> Call.BorderColor3 = Color3.new(0, 0, 0)
> 
> Call.Parent = script.Parent
> 
> Call.Name = (game.Workspace.Fire_Control.Control_Global.Fire_Control.Fire_Call_Number_Folder.Value .. "Callout_Number")
> 
> local Call_Status = Instance.new("TextLabel")
> 
> Call_Status.Position = UDim2.new(-0.6, 0,-1.3, 0)
> 
> Call_Status.Size = UDim2.new(0, 200, 0, 50)
> 
> Call_Status.BackgroundTransparency = 1
> 
> Call_Status.BorderSizePixel = 0
> 
> Call_Status.Parent = Call
> 
> Call_Status.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Bold)
> 
> Call_Status.TextSize = 14
> 
> Call_Status.Text = "UAC"
> 
> Call_Status.Name = "Callout_Status"
> 
> local Call_Type = Instance.new("TextLabel")
> 
> Call_Type.Position = UDim2.new(-0.3, 0,-1.3, 0)
> 
> Call_Type.Size = UDim2.new(0, 200, 0, 50)
> 
> Call_Type.BackgroundTransparency = 1
> 
> Call_Type.BorderSizePixel = 0
> 
> Call_Type.Parent = Call
> 
> Call_Type.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Bold)
> 
> Call_Type.TextSize = 14
> 
> Call_Type.Text = "A.0.0"
> 
> Call_Type.Name = "Call_Type"
> 
> local Call_Open = Instance.new("TextButton")
> 
> Call_Open.Position = UDim2.new(0.75, 0, 0, 0)
> 
> Call_Open.Size = UDim2.new(0, 35, 0, 15)
> 
> Call_Open.BackgroundTransparency = 0
> 
> Call_Open.BackgroundColor3 = Color3.new(0.4, 1, 0)
> 
> Call_Open.Selectable = true
> 
> Call_Open.BorderSizePixel = 0
> 
> Call_Open.Parent = Call
> 
> Call_Open.FontFace = Font.new("rbxasset://fonts/families/SourceSansPro.json", Enum.FontWeight.Bold)
> 
> Call_Open.TextSize = 14
> 
> Call_Open.Text = "OPEN"
> 
> Call_Open.Name = "Call_Open"
> 
> ---------------------------
> 
> local Callout_Details = Instance.new("Frame")
> 
> Callout_Details.Visible = false
> 
> Callout_Details.Size = UDim2.new(0, 142, 0, 15)
> 
> Callout_Details.BackgroundColor3 = Color3.new(0.705882, 0.705882, 0.705882)
> 
> Callout_Details.BackgroundTransparency = 0
> 
> Callout_Details.BorderSizePixel = 1
> 
> Callout_Details.Parent = script.Parent.Parent.Callouts_Details
> 
> Callout_Details.Name = (game.Workspace.Fire_Control.Control_Global.Fire_Control.Fire_Call_Number_Folder.Value .. "Callout_Number_Details")
> 
> ---------------------------
> 
> local Callout_Details_Link = Instance.new("ObjectValue")
> 
> Callout_Details_Link.Parent = Call
> 
> Callout_Details_Link.Value = Callout_Details
> 
> Callout_Details_Link.Name = "Callout_Details_Link_Value"
> 
> local Callout_Link = Instance.new("ObjectValue")
> 
> Callout_Link.Parent = Call
> 
> Callout_Link.Value = Call
> 
> Callout_Link.Name = "Callout_Link_Value"
> 
> ---------------------------
> 
> local Callout_Link = Instance.new("ObjectValue")
> 
> Callout_Link.Parent = Callout_Details
> 
> Callout_Link.Value = Call
> 
> Callout_Link.Name = "Callout_Link_Value"
> 
> local Callout_Link = Instance.new("ObjectValue")
> 
> Callout_Link.Parent = Callout_Details
> 
> Callout_Link.Value = Callout_Details
> 
> Callout_Link.Name = "Callout_Details_Link_Value"
> 
> ---------------------------
> 
> wait(.1)
> 
> local Callout_Details_Frame_Script = script.Parent.Demo_Callout_Number.Call_Open.Callout_Frame_Details:Clone()
> 
> Callout_Details_Frame_Script.Parent = Call_Open
> 
> ---------------------------
> 
> end)

Thats the whole script it is at the bottom it clones and everything just doesn’t function with the script inside another frame.

And if nothing else runs etc.Fire_Call_Remote:FireClient then that entire script will not run, that’s what the .OnClientEvent:Connect part means, it needs a event to be fired to run.

Can you use discord Il explain easier It all works just not that frame part if you can VC quickly.

Discord FoxysFire_Photo#4252

No I cannot. Nor do I believe the problem is that complicated. The script is over complicated but it won’t be run unless that event is fired. You could remove most of the script by making your GUI in the explorer and cloning it instead of so many instance.new and parameter setting.

So It won’t open a frame without a event being fired… as it clones and everything even print