I'm trying to make it so that when the player presses the button, the surfacegui changes the text, then it spits out the item the player requested, all of the surfacegui stuff works except for the part where it's supposed to give the player the part.
local cd = script.Parent.ClickDetector
local TextLabel = game.Workspace.MainScreen:WaitForChild("GuiPart"):WaitForChild("SurfaceGui"):WaitForChild("TextLabel")
local Model = game.ReplicatedStorage.Model
cd.MouseClick:Connect(function()
wait(1)
TextLabel.Text = "STARTING PROCESS..."
wait(5)
TextLabel.Text = "REQUESTED ITEM EJECTED, THANK YOU."
wait(1)
TextLabel.Text = "PLEASE PUSH BUTTON TO GET STARTED"
wait(6)
local Clone = Model:Clone()
for _, part in pairs(Clone:GetChildren()) do
part.Parent = workspace
part.Position = Vector3.new(54.62, 4.17, 31.68)
end
end)

1 comment
why are you setting the position of the parts manually.. You could just set it to another part's position. So wherever you place it in the game world it would still work.