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

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

Asked by 5 years ago
Edited 5 years ago

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

0
Local or server script and where is the script located? 522049 152 — 5y
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 thebayou 441 — 5y
0
these two are server sided maumaumaumaumaumau 98 — 5y

1 answer

Log in to vote
0
Answered by
thebayou 441 Moderation Voter
5 years ago
Edited 5 years ago

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).

0
the second script loaded FIRST maumaumaumaumaumau 98 — 5y
0
how do you know that for sure thebayou 441 — 5y
1
Also your print is wrong it should be print("hello object") mixgingengerina10 223 — 5y
1
That's not wrong If you pass a string/table literal as an argument to print, the parenthesis are not required. User#19524 175 — 5y
0
Oh, thanks for the info then. mixgingengerina10 223 — 5y
Ad

Answer this question