Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == "the name you want" then
-- script you want to run --
end
end)
0
I have proximity scripts. usmaniusmangamer15 9 — 4y
0
Whoops-. But where was Player.Backpack? Could you show me that part of the script? charizardstar87 16 — 4y
Ad

Answer this question