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

How to make buttons send signals?

Asked by 3 years ago

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!`~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~

1 answer

Log in to vote
-1
Answered by 3 years ago

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!

Ad

Answer this question