Hello, Friends! Would you help me please? "attempt to index nil with 'Clone'"

Hello! I having attempt to index nil with 'Clone', would you help me?

Im doing and Admin ‘Give Gui’, for my jojo game that will be giving stands/items, but when trying to clone item it writes error that i wrote upper.
I have an Script named ‘ItemGive’ for button
In this i written:

local v1 = script.Parent.Parent.ItemTab
local bu = v1.giveButton
local v2 = v1.chosenPlayerValue
local v3 = v1.chosenItemValue
local gV2 = game.Players:FindFirstChild(v2.Value)
local gV3 = game.ServerStorage.Items:FindFirstChild(v3.Value)

bu.MouseButton1Click:Connect(function()
	local g = gV3:Clone()
	g.Parent = gV2.Backpack
end)

Also i have script that puts nickname and item to give in stringvalue, and this explorer of givegui.
image
Can you help me?

4 Likes

You can’t access serverstorage with localscripts.

1 Like

Its Script, i wrote upper, and i shown SS of explorer when you can see that script, its “ItemGive”

Then in that case I don’t believe you can call an activation event on a button through a server script.

1 Like

Try using a WaitForChild, because the error is a literal statement, you’re trying to clone nothing (nil)

So the variable you are trying to clone isn’t there or you made it so that the variable isn’t a thing you can clone()

It’s there.
image

While using WaitForChild, it gives me ‘Infinite yield possible on ‘ServerStorage.Items:WaitForChild("")’’

I think if it gives error with cloning, then it works.

Then the item you’re trying to clone does not exist. try using a tool to clone instead and see if it works.

It apparently can’t find the tool.
This could be because the value of chosenitem is not a name that can be found in the tool folder

What do you mean by “Tool to clone”?

ChosenItemValue gets when admin clicks on button that contains name of item, and it gets names from ServerStorage.Items, are there can be any other reasons?
image

Are you sure the value is an object value?

Nope, its string value, i thought it will work with FindFirstChild(String.Value)? And also i dont know how to use object value…

Yea that should work. aaaaaaaa

Found some new info, its not finding value in chosenitemvalue and chosenplayervalue, thats why nil, but when i checking in explorer while clicked on nickname/item there are a value of item and player, any variants why is it going on?
image

You cannot access ServerStorage locally. Try setting the RunContext of the script to Server.

Do you mean by LocalScript, if you meant local script, then its Script.
image

Set the Script named “ItemGive” and “ItemSelect” RunContext to “Server” and tell me what happens.