Attempted to index nil with parent [Solved]

Huh… I see you’re using a proximity prompt in your error code. In this case, what is script.Parent? Is it a proximity prompt?

his script is inside a proximity promt in the workspace not the tool itself

script.Parent = player.Backpack

The script is inside the backpack? Edit: Also, what is the thing that is being triggered to activate this script?

I’m not holding the tool? What are you talking about?

the tool is inside replicated storage so the player cant equip the tool. since all tools comming from there are cloned and not the original

No. The script is not inside the backpack.

the trigger is a proximityPromt

Wait, so I have to set it to false for it to work?

Yeah, that’s what I thought. I think you might have to use ProximityPrompt service.

could be, but the weird thing is. it works in one studio but not in the other.

That’s the issue, the exact same script worked in a different game. Why would that be necessary?

Yeah, I don’t understand that part.

No, it must be true.

Then that wouldn’t be the issue.

Well, typically when dealing with ProximityPrompts, you would use:

local ProximityPromptService = game:GetService("ProximityPromptService")

ProximityPromptService.PromptTriggered:Connect(function(prompt,player)
end)

well triggerd works too, for all my games. but just not for his main game. thats so weird?

Maybe the player variable in the original script is actually the prompt being triggered, and a second argument to the function would be the player? You could try printing out the value of player just to be sure.

Yeah, I’m just thinking of anything that might work.

Nope, still the same issue.

  20:39:46.550  Workspace.Model.Lemon.ProximityPrompt.GiveScript:9: attempt to index nil with 'Parent'  -  Server - GiveScript:9
  20:39:46.550  Stack Begin  -  Studio
  20:39:46.550  Script 'Workspace.Model.Lemon.ProximityPrompt.GiveScript', Line 9  -  Studio - GiveScript:9
  20:39:46.550  Stack End  -  Studio