Hey! I’m making a cafe roleplaying game on Roblox and once the Chef has completed the order, they need to put it at the pick-up station for the customer to come and collect it. What I’m trying to figure out is how I would make the items appear on the pickup bench when the Chef puts them down and I’m not sure of the best way to do this. Any help with this would be appreciated.
The tool is equipped only when it is parented to a character. So simpy reparent it somewhere else (workspace for example), and set the position of the handle where you want
Would setting the Handle’s position change the position of all of the other parts of the tool?
It should if all the other parts are welded or somehow else connected to the handle
What would be the most ideal way to change the position of the Handle?
Handle.Position = position
(Why does roblox require many chars for a reply, its annoying)
I actually do this exact thing for one of my existing projects. Assuming all the parts are welded, try this:
Once handing item into the pickup station has been initialized:
- Unequip the tool from the players character assuming they are holding the item. (put it back in backpack)
- Change the tools parent to workspace or something in workspace.
- Edit the CFrame of the handle to the desired CFrame (I don’t think that position is actually going to work for this. Assuming you’re using position it would most likely just bring the handle to the position rather than the entire tool.)
- Once it’s in the desired place, make sure to anchor it.
I’d probably recommend making the descendants of the tool a model before placing it down. Assuming you turn it into a model, you’d have a lot more freedom with moving it in terms of position.
Thanks for your response.
How would I make the descendants of the tool a model using a script? I don’t believe there’s a method to group parts using a script but correct me if I’m wrong.
Also, to anchor it would I just get it’s descendants and anchor all of the baseparts?
Edit: When you say you recommend making the descendants of the tool a model, do you mean doing this in the tool itself outside of a script in studio?
What I mean by making it a model rather than a tool is that once you go to place it down convert the tool to a model instead, it might work better to get your positioning right and everything. When someone goes to pickup the item you can simply destroy the model and then clone the tool via the name from wherever you keep the tools.
One potential way I could think of is making a new model via a script, then parenting all the descendants to that model. It would probably look something like the following:
local newModel = Instance.new("Model")
for _, v in pairs(player.Character:FindFirstChildWhichIsA("Tool"):GetDescendants()) do -- used whatever tool the player is holding as an example, not sure if u wanted it to be the tool the player is holding but it should work regardless if you reference the tool
if v:IsA("BasePart") then
v.Parent = newModel
v.Anchored = true
end
end
player.Character:FindFirstChildWhichIsA("Tool"):Destroy() -- destroy so its not still in the hotbar
newModel.Parent = workspace -- workspace or like the pickup table or something
newModel:MoveTo(workspace.PickUp.Position)
A method like this would make it pretty simple to just move the model to the desired position and it would be less weird having tools parented to the pickup table. You’d probably have to destroy the actual tool because this is going to leave the tool still in the inventory but with no descendants, meaning it will still appear in the hotbar but wont have anything associated with it.
Make the tool in player backpack parent to workspace
then changing the handle of the tool to set the tool in a place
One thing, you should know is, if a player touches the tool on the table, they get the tool, so you should probably add an invisible wall to avoid alot of players or random players taking the tool instead of the player you wish to
Thanks so much for all of your help, appreciated.
Your post has solved my issue so I’ve marked it as solution, however there’s one problem that I expected to happen with every solution. The items are floating once they’re moved to the pickup bench. Any ideas of solutions to this?
Edit: Additionally, :MoveTo() does not seem to move the items up until they aren’t touching anything as described on it’s wiki page. This is due to the fact that these are meshes, I suspect?