Im trying to store the name of a part in a string variable. but I keep getting this error: Players.Paczki_TCBC.PlayerScripts.LocalScript:35: invalid argument #3 (string expected, got Instance)
here's the part of my script that is broke:
UIS.InputEnded:Connect(function(input) if input.KeyCode == Enum.KeyCode[pickupkey] then if mouse.Target then if mouse.Target:FindFirstChild("Pickable") then local item = mouse.Target if item then local distanceFromItem = player:DistanceFromCharacter(item.Position) if distanceFromItem < 7 then -- we fill this in loadstring print("poopy") game.ReplicatedStorage.Items.Value = item -- THIS IS THE TROUBLSOME LINE PickupItem:FireServer(item) end end end end end end)
As NGC4637 said, item is an instance. The value is a string, so you'd want to do item.Name