Problem with cloning from server storage

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I need to clone a screenGUI from server storage.

  2. What is the issue? Include screenshots / videos if possible!
    Error is: image
    but:
    image

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tryed to clone from workspace, but got something more strange for me

My code:

local PlayerService = game:GetService("Players")
local Player = PlayerService.LocalPlayer
local GuiService = Player.PlayerGui
local GameGUI = GuiService.GameGUI
local PlayableFrame = GameGUI.GameFrame.PlayableFrame
local RNGBar = GameGUI.GameFrame.PlayableFrame.RNGBar
local RNGProgress = RNGBar.RNGP
local RNGBarFiller = RNGBar.Filler
local RNGClicker = script.Parent
local RNGMultiValue = script.Parent.RNGMulti
local RNGNumber = 0
local ClickWait = 0
local debounce = false
local RNGnumbern = 10
local FullF = 1
local Filler1Part = 1/RNGnumbern
local FillerProgress = 0
local Points = game.Players.LocalPlayer.leaderstats.Points
local GotAPoint = game.ServerStorage["GotAPoint!"]
local GotAPointLabel = game.ServerStorage["GotAPoint!"].TextLabel
local Xpcoor = math.random(0.1,1)
local Ypcoor = math.random(0,1,1)
RNGClicker.MouseButton1Click:Connect(function()
	if debounce then
		return
	end
	debounce = true
	RNGNumber = math.random(1,10)
	RNGProgress.Text = RNGNumber.."/"..RNGnumbern
	ClickWait = 20
	FillerProgress = (RNGNumber * Filler1Part)
	print(FillerProgress)
	RNGBarFiller.Size = UDim2.new(FillerProgress,0,0,100)
	if RNGNumber == RNGnumbern then
		Points.Value = Points.Value + 1
		RNGProgress.Text = (0).."/"..RNGnumbern
		RNGBarFiller.Size = UDim2.new(0,0,0,100)
		local GotAPointClone = GotAPoint:Clone()
		GotAPoint.Parent = PlayableFrame
		GotAPointLabel.Position = UDim2.new()
	end
	repeat
		ClickWait -= 1
		RNGClicker.Text = (math.round(ClickWait - 1)/10)
		wait(0.1)
	until ClickWait <= 0.3
	ClickWait = 0
	RNGClicker.Text = "Click to Generate!"
	debounce = false
end)



ServerStorage does not replicate to the client, try ReplicatedStorage. What exactly are you trying to achieve here by cloning it?

Okay sure thanksssssssssssssss

Uhhh idk how to say that right, just like clone text when player make a thing which needed and that text will go up. So i need to clone it to make it more whan 1 time

is this a normal script or local?

You can only access the “ServerStorage” folder from a server script, the “ReplicatedStorage” folder on the other hand can be accessed from both local scripts and server scripts.

I’m assuming local because of the “LocalPlayer” index on the second line in the code provided. Correct me if I’m wrong OP.

I literally just said that as my first response.

local GotAPoint = game.ServerStorage:WaitForChild("GotAPoint!")
local GotAPointLabel = GotAPoint:WaitForChild("TextLabel")

Replace those 2 lines with these 2 if the script is a server script already.
If it is a local script and moving the “Gui” to “ReplicatedStorage” doesn’t work then try the following 2 lines of code:

local GotAPoint = game.ReplicatedStorage:WaitForChild("GotAPoint!")
local GotAPointLabel = GotAPoint:WaitForChild("TextLabel")

i guess its also because of the “mousebutton1press”

Omaga i already solved that thanks guyss

Just used replicated storage for that

Got a new problem, can’t destroy a cloned thing after 3 seconds.

local PlayerService = game:GetService("Players")
local Player = PlayerService.LocalPlayer
local GuiService = Player.PlayerGui
local GameGUI = GuiService.GameGUI
local PlayableFrame = GameGUI.GameFrame.PlayableFrame
local RNGBar = GameGUI.GameFrame.PlayableFrame.RNGBar
local RNGProgress = RNGBar.RNGP
local RNGBarFiller = RNGBar.Filler
local RNGClicker = script.Parent
local RNGMultiValue = script.Parent.RNGMulti
local RNGNumber = 0
local ClickWait = 0
local debounce = false
local RNGnumbern = 10
local FullF = 1
local Filler1Part = 1/RNGnumbern
local FillerProgress = 0
local Points = game.Players.LocalPlayer.leaderstats.Points
local GotAPoint = game.ReplicatedStorage["GotAPoint!"]
local GotAPointLabel = game.ReplicatedStorage["GotAPoint!"].TextLabel
local Xpcoor = math.random(0.1,1)
local Ypcoor = math.random(0.1,1)
RNGClicker.MouseButton1Click:Connect(function()
	if debounce then
		return
	end
	debounce = true
	RNGNumber = math.random(1,10)
	RNGProgress.Text = RNGNumber.."/"..RNGnumbern
	ClickWait = 20
	FillerProgress = (RNGNumber * Filler1Part)
	print(FillerProgress)
	RNGBarFiller.Size = UDim2.new(FillerProgress,0,0,100)
	if RNGNumber == RNGnumbern then
		Points.Value = Points.Value + 1
		RNGProgress.Text = (0).."/"..RNGnumbern
		RNGBarFiller.Size = UDim2.new(0,0,0,100)
		local GotAPointClone = GotAPoint:Clone()
		GotAPointClone.Parent = PlayableFrame
		GotAPointClone.GotAPointLabel.Position = UDim2.new(Xpcoor,0,Ypcoor,0)
		wait(3)
		GotAPointClone:Destroy()
	end
	repeat
		ClickWait -= 1
		RNGClicker.Text = (math.round(ClickWait - 1)/10)
		wait(0.1)
	until ClickWait <= 0.3
	ClickWait = 0
	RNGClicker.Text = "Click to Generate!"
	debounce = false
end)



Can you share a screenshot of the ScreenGui inside StarterGui with its children?

it’s saying “gotAPoint” is the child of GotApoint on the Output, can we see the explorer screenshot

I figured out a problem, just i did a stupid thing

local PlayerService = game:GetService("Players")
local Player = PlayerService.LocalPlayer
local GuiService = Player.PlayerGui
local GameGUI = GuiService.GameGUI
local PlayableFrame = GameGUI.GameFrame.PlayableFrame
local RNGBar = GameGUI.GameFrame.PlayableFrame.RNGBar
local RNGProgress = RNGBar.RNGP
local RNGBarFiller = RNGBar.Filler
local RNGClicker = script.Parent
local RNGMultiValue = script.Parent.RNGMulti
local RNGNumber = 0
local ClickWait = 0
local debounce = false
local RNGnumbern = 10
local FullF = 1
local Filler1Part = 1/RNGnumbern
local FillerProgress = 0
local Points = game.Players.LocalPlayer.leaderstats.Points
local Storage = game.ReplicatedStorage
local GotAPoint = Storage:WaitForChild("GotAPoint!")
local GotAPointLabel = GotAPoint:WaitForChild("TextLabel")
local Xpcoor = math.random(0.1,1)
local Ypcoor = math.random(0.1,1)
RNGClicker.MouseButton1Click:Connect(function()
	if debounce then
		return
	end
	debounce = true
	RNGNumber = math.random(1,10)
	RNGProgress.Text = RNGNumber.."/"..RNGnumbern
	ClickWait = 20
	FillerProgress = (RNGNumber * Filler1Part)
	print(FillerProgress)
	RNGBarFiller.Size = UDim2.new(FillerProgress,0,0,100)
	if RNGNumber == RNGnumbern then
		Points.Value = Points.Value + 1
		RNGProgress.Text = (0).."/"..RNGnumbern
		RNGBarFiller.Size = UDim2.new(0,0,0,100)
		local GotAPointClone = GotAPoint:Clone()
		GotAPointClone.Parent = PlayableFrame
		GotAPointClone.GotAPointLabel.Position = UDim2.new(Xpcoor,0,Ypcoor,0)
		wait(3)
		GotAPointClone:Destroy()
	end
	repeat
		ClickWait -= 1
		RNGClicker.Text = (math.round(ClickWait - 1)/10)
		wait(0.1)
	until ClickWait <= 0.3
	ClickWait = 0
	RNGClicker.Text = "Click to Generate!"
	debounce = false
end)

Use this by the way, it’ll wait for the UI instances to load before attempting to use them inside the script.

Bro i fixed, i just was put screenGUI in frame lol

A quick question, can’t math.random save double variables? Just like i need make random position from 0.1 to 1

local randFloat = (math.random(1, 10))/10

Yeah, just get a random integer from 1 to 10 and divide by 10.