Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I find a tool inside of a regular serverscript?

So, the other day I tried to make a tool script where it would find your tool and destroy it, however when I tried doing that it ended up having a couple of errors such as:

"Backpack isnt a valid member of player", and I cant even find a way to fix that, can anyone help me?

	local ProximityPromt = script.Parent.ProximityPrompt
	--- Pizza Models
	local Pizza1 = game.Workspace.Pizza1
	local Pizza2 = game.Workspace.Pizza2
	local Pizza3 = game.Workspace.Pizza3
	local Pizza4 = game.Workspace.Pizza4
 
 
ProximityPromt.Triggered:Connect(function()
	ProximityPromt.ActionText = "Cook"
	    if ProximityPromt.ActionText == "Cook" then
			        Pizza1.Transparency = 0
			        ProximityPromt.Enabled = false
		wait(15)
		ProximityPromt.Enabled = true
		ProximityPromt.ActionText = "Pick Up"
		ProximityPromt.Triggered:Connect(function()
			Pizza1.Transparency = 1
			wait(5)
			ProximityPromt.ActionText = "Cooldown..."	
		end)
				     
			 
	end
end)

1 answer

script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == "the name you want" then
-- script you want to run --
end
end)

2 comments

0

I have proximity scripts.

0

Whoops-. But where was Player.Backpack? Could you show me that part of the script?

This discussion is preserved as it was. New answers, comments, and votes are closed.