I have 2 questions. How can I make a script that so when I press the GUI button, an npc spawns. Somewhat like Work at a Pizza Place. Also when i press a part button, it makes an item pop up. Please respond soon, thanks!`~~~~~~~~~~~~~~~~~
I have 2 questions. How can I make a script that so when I press the GUI button, an npc spawns. Somewhat like Work at a Pizza Place. Also when i press a part button, it makes an item pop up. Please respond soon, thanks!`~~~~~~~~~~~~~~~~~
You can use remote events for it.
I'll give you a example duplicating a instance(in this it would be a character npc) to workspace.
-- client
local event
local button
button.Activated:Connect(function()
event:FireServer()
end)
--server
local event
event.OnServerEvent:Connect(function()
local npc
local cloned_npc = npc:Clone()
cloned_npc.Parent = workspace
end)
and the it would be the same thing with the item poping up, using :Clone() is very helpful!
This discussion is preserved as it was. New answers, comments, and votes are closed.