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

How do I make it so multiple people can receive the tool upon triggering a prompt?

Asked by 1 year ago
Edited 1 year ago

I've looked at basic tutorials that only let YOU pick up the tool because the tool goes inside the person's backpack if they triggered it and the tool disappears. How would I make it so multiple people can pick it up? This is the script


local tool = game.ServerStorage.AdvancedFlashlight local prompt = script.Parent.ProximityPrompt local function pickup(player) tool.Parent = game.Workspace[player.Name] end prompt.Triggered:Connect(pickup)

The actual tool itself is in server storage, so if the player steps on the duplicate handle in the workspace, it won't give them the part. However if someone does trigger the prompt it gives them the tool, but if someone else triggers it, it steals the tool and gives it to that player who triggered it.

0
can you add the script you tried? aviel101 165 — 1y

1 answer

Log in to vote
0
Answered by
aviel101 165
1 year ago
Edited 1 year ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.

when you're doing

tool.Parent = game.Workspace[player.Name]

you're taking the tool from the server storage and moving it to the player, and then when you try to get the tool again it won't be there.

so you'll have to clone it first and then move it to the player

tool:Clone().Parent = game.Workspace[player.Name]
Ad

Answer this question