Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Cloning localscripts to player's backpack doesn't work?

Hello , I was doing some scripting , when i was going to clone a local script to a player it didn't work, it dropped NO errors , no infinite yielding and these two are server sided, and the localscript to clone creates a GUI 1

				local guitoClone=script.LocalScripts.addRCV:Clone()
				guitoClone.Parent = plr.Backpack
				guitoClone.Disabled = false

plr is a player object i tried this to check 2

game.Players.maumaumaumaumaumau.Backpack.ChildAdded:Connect(function()
print"hello object"
end)

and nothing happened... why does this not work?? #1 , btw the second script loaded FIRST

3 comments

0

Local or server script and where is the script located?

0

522049 brought up a good point; for the first script, if it's a localscript then it will fail to replicate and the second event (presumably inside a serverscript) will not get fired

0

these two are server sided

1 answer

It probably didn't work because the first script ran before the second one, which meant that by then the object was already inside the backpack, and the script missed the event.

Edit: Also, if the first script is inside a client script and the second script a server script, then due to FilteringEnabled, the modifications will not replicate to the server and the server will be oblivious to the changes (and therefore the event will not be fired).

5 comments

0

the second script loaded FIRST

0

how do you know that for sure

1

Also your print is wrong it should be print("hello object")

1

That's not wrong If you pass a string/table literal as an argument to print, the parenthesis are not required.

0

Oh, thanks for the info then.

This discussion is preserved as it was. New answers, comments, and votes are closed.