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

Is there a limit on the number of local scripts in the StarterGui?

Asked by 6 years ago
Edited 6 years ago

I have 2 local scripts in the StarterGui at the moment that are both initially disabled.One of them places a room, and the other places a single block. When you click on a button, it changes the script to enabled and allows the user to place the room. Here is the code inside the button that activates the placement script:

placement = script.Parent.Parent.Parent.StorageRoomPlacement

script.Parent.MouseButton1Click:connect(function()

    placement.Disabled = false

end)

However whenever I start the game, it outputs an error that says: "20:55:49.221 - StorageRoomPlacement is not a valid member of PlayerGui", and now the other script says the same thing. Are you only allowed a certain amount of local scripts in the StarterGui or is it something else?

2
There is no limit on how many scripts you can have in StarterGui. XAXA 1569 — 6y
2
I don't think ROBLOX sets a cap, but too many will affect game performance. Your error means that the path is incorrect. It may not have loaded yet(use WaitForChild()) or you may have moved it or its just pointing to the wrong location lukeb50 631 — 6y
0
It will lag your game if you make the scripts laggy but there is no limit greatneil80 2647 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Try this.

Put this script in the GUI button.

local ServerStorage = game:GetService("ServerStorage") --use this to find the server storage(put the localscript in here)

placement = ServerStorage.localscript

script.Parent.MouseButton1Click:connect(function()
    local location= ServerStorage.placement:Clone() --makes a copy of the script
    location.Parent = game.Workspace -- replace game.Workspace with the location you want the script to goto.
    location.Disabled = false
end)

If it helps, then accept my answer please.

Ad

Answer this question