I keep getting an error on a line of code that should change a string value to the name of a part, and it makes no sense to me please help.
here's my script (Its only a small part of it to keep it simple, but i assure you everything else works):
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("worked")
game.ReplicatedStorage.Name.Value = item --HERES WERE THE ERROR POINTS OUT
PickupItem:FireServer(item)
end
end
end
end
end
end)
the error says: Players.Paczki_TCBC.PlayerScripts.LocalScript:35: attempt to index string with 'Value'
Please help dude, my head hurts.

1 comment
You would need to change the name of your string value.