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

Item returns as a nil value?

alright so on line 4 it tells me that Itemis nil but if i change it to Item.Name in the params it says arg 1 is missing and i have no idea how to fix it other than changing to .Name and getting the arg mising error

Script:

game.ReplicatedStorage.Purchase.OnServerEvent:Connect(function(Player,Product)
	local string = "You Purchased "..Product.."!"
	local Crates = game.ServerStorage:FindFirstChild(Player.Name.."'s Crates")
	local Item= Crates:FindFirstChild(Product)
	Item.Value = Item.Value + 1
	game.ReplicatedStorage.ExploitsWillAbuseThis:FireClient(Player,string)
end)

1 answer

game.ReplicatedStorage.Purchase.OnServerEvent:Connect(function(Player,Product) local string = "You Purchased "..Product.."!" local Crates = game.ServerStorage:FindFirstChild(Player.Name.."'s Crates") local Item= Crates:FindFirstChild(string) -- how about the string variable? Item.Value = Item.Value + 1 game.ReplicatedStorage.ExploitsWillAbuseThis:FireClient(Player,string) end)

1 comment

0

oh god

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