Need help on proximity prompt and tool

Try to replace:

print(ToolEquipped.Name)

With:

print(ToolEquipped)

See if it changes anything.

1 Like

It says nil in output, even through I have the tool equipped. That’s weird.

1 Like

Send a pickture of the workspace please

1 Like

image
?

1 Like

Send a pickture of the script and output when tou run it

script.Parent.Triggered:Connect(function(Player)
	
	local ToolEquipped = Player.Character:FindFirstChildOfClass('Tool')
	print(ToolEquipped)
	
	local toolName = ToolEquipped.Name

		if toolName == "Cake Dough" then
			ToolEquipped:Destroy()
			local Clone = game.ServerStorage["Rolled Cake Dough"]:Clone()
			Clone.Parent = Player.Backpack
			print("working!")

		elseif toolName == "Cookie Dough" then
			ToolEquipped:Destroy()
			local Clone = game.ServerStorage["Rolled Cookie Dough"]:Clone()
			Clone.Parent = Player.Backpack
			print("working!")

		elseif toolName == "Cupcake Dough" then
			ToolEquipped:Destroy()
			local Clone = game.ServerStorage["Rolled Cupcake Dough"]:Clone()
			Clone.Parent = Player.Backpack
			print("working!")

		elseif toolName == "Mochi Dough" then
			ToolEquipped:Destroy()
			local Clone = game.ServerStorage["Rolled Mochi Dough"]:Clone()
			Clone.Parent = Player.Backpack
			print("working!")

		elseif toolName == "Muffin Dough" then
			ToolEquipped:Destroy()
			local Clone = game.ServerStorage["Rolled Muffin Dough"]:Clone()
			Clone.Parent = Player.Backpack
			print("working!")
		end
end)
1 Like

Let me copy your situation and get to solution making

2 Likes

Works for me (dont mind thissss)

1 Like

I know your problem you art equiping the cake do dough

1 Like

I equipped the cake through? I’m not sure.

1 Like

You try it with the cake dough outlined blue

1 Like

Still doesn’t work if I use any of the cakes.

1 Like

@iiheavenlymarsx You might want to try and inspect the scripts which revolve around editing the Player’s backpack.

In the meanwhile, I’ll link this post as an alternative workaround for this issue:

(Just delete the Player variable and replace it with the ProximityPrompt being triggered. If this works, do mark this as the solution of this post.)

2 Likes

Thanks, I’ll try it out.

1 Like

1 Like

I think that’s just because you don’t have the original tool on your side.

It takes the tool away dhdjdjdjrjr

1 Like

you dont have the tool in your Place

1 Like

I had a tool called cookiedough

1 Like

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