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

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

Asked by 10 years ago

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

Log in to vote
-1
Answered by
X888X 15
10 years ago

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

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

0
Thanks Relampago1204 73 — 10y
0
But it still won't work? Relampago1204 73 — 10y
0
May you tell me what it says in the output? X888X 15 — 10y
0
ok Relampago1204 73 — 10y
View all comments (11 more)
0
Also may I ask where is script.Parent.Parent.Parent.Parent located? X888X 15 — 10y
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 Relampago1204 73 — 10y
0
Try this "Player = game.Players.LocalPlayer.Backpack" X888X 15 — 10y
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 Relampago1204 73 — 10y
0
And I still can't click the GUI Relampago1204 73 — 10y
0
Remove ".Backpack" from Player = ... X888X 15 — 10y
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 Relampago1204 73 — 10y
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. X888X 15 — 10y
0
It is ok Relampago1204 73 — 10y
0
I don't know what I did but I fixed it THANK YOU !!! Relampago1204 73 — 10y
0
Glad to see your code now works! Enjoy! X888X 15 — 10y
Ad

Answer this question