Tool Disappears After Reparenting It

Hi There Scripters,

I’ve been trying to make it so you can pick up an orb through a Prompt, which then reparents it to the Player’s Backpack, but I’m stuck on this issue where the orb just disappears when reparented.

The Orb Doesn’t get destroyed, but just disappears which is really strange,
I think it’s a problem with the Backpack because when I printed the Backpack’s Parent it Came back with nil

Here is my Script:

--------------------------------------------------<<< VARIABLES

local Player = game.Players.LocalPlayer
local Backpack: Backpack = Player:WaitForChild("Backpack")

local OrbTool = workspace:WaitForChild("Orb")
OrbTool:WaitForChild("Handle"):WaitForChild("TouchInterest"):Destroy()

local OrbPrompt = OrbTool:WaitForChild("ProximityPrompt").

--------------------------------------------------<<< FUNTIONALITY

OrbPrompt.Triggered:Connect(function()
	
	OrbTool.Parent = Backpack
	OrbTool.Orb.ProximityPrompt.Enabled = false
	
	OrbTool.Handle.Anchored = false
	OrbTool.Orb.Anchored = false
	
end)

Thanks a lot for your help!

I think you’re supposed to do local Backpack = Player:WaitForChild("Backpack")

Without that colon thing

1 Like

oh the colon is for type notation, its supposed to be there

either one is acceptable, he’s initializing the variable before setting it equal to an instance.

2 Likes

I would try using a remote event from the client’s local script function to give the tool to the player. I just did a simulation, and I was able to clone the tool from the workspace into the player’s backpack.

The client can see the tool in the workspace and access it’s data, but it cannot replicate it into the player’s backpack as it doesn’t have authority from the server. To equip and use the tool, the move would have to be done from the server.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.