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

How to clone a Hopper Bin to a players backpack with a Image button?

My script is

Player = script.Parent.Parent.Parent.Parent

function onClicked()
	script.Disabled = true
	if Player.Character:FindFirstChild("Natsu Dragneel(FDS)") == nil then
	if Player.Backpack:FindFirstChild("Natsu Dragneel(FDS)") == nil then
	Natsu = game.ReplicatedStorage["Natsu Dragneel(FDS)"]:Clone()
        Natsu.Parent = Player.Backpack
	end
	end
	wait()
    script.Disabled = false
	end
	
	script.Parent.MouseButton1Click:connect(onClicked)

I need help because I want to clone the hopper bin to the players backpack. The script won't work with a Image button but it will work with a text button. What am I doing wrong?

Also my explorer say this in the order Starter Gui Screen Gui Frame Image Button Script

1 answer

✓ Accepted answer

Try this, spaces don't work without quoting them.

Natsu = game.ReplicatedStorage["Natsu Dragneel(FDS)"]:Clone()

15 comments

0

Thanks

0

But it still won't work?

0

May you tell me what it says in the output?

0

ok

0

Also may I ask where is script.Parent.Parent.Parent.Parent located?

0

17:50:20.218 - Character is not a valid member of PlayerGui 17:50:20.219 - Script 'Players.Player.PlayerGui.Character Selection.Frame.Natsu.Sc', Line 5 17:50:20.220 - Stack End 17:50:20.221 - Disconnected event because of exception 17:50:22.807 - doLoadAppearance http://www.roblox.com/Asset/?versionid=359516628&serverplaceid=108284977 time: 5.036288

0

Try this "Player = game.Players.LocalPlayer.Backpack"

0

17:53:42.311 - Character is not a valid member of Backpack 17:53:42.313 - Script 'Players.Player.PlayerGui.Character Selection.Frame.Natsu.Sc', Line 5 17:53:42.315 - Stack End

0

And I still can't click the GUI

0

Remove ".Backpack" from Player = ...

0

17:59:45.799 - Auto-Saving... 17:59:53.612 - Character is not a valid member of Backpack 17:59:53.616 - Script 'Players.Player.PlayerGui.Character Selection.Frame.Natsu.Sc', Line 5 17:59:53.619 - Stack End

0

I don't get it... Backpack no longer exists in Player = ... Character should be independent, I gotta go for now, sorry I couldn't help.

0

It is ok

0

I don't know what I did but I fixed it THANK YOU !!!

0

Glad to see your code now works! Enjoy!

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