Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to spawn an ncp over a gui?

I tried to make an NPC spawner over a GUI, and just couldn't get it to work. It breaks when I spawn it and other players can't see it could someone help me?

script.Parent.Activated:Connect(function()
local NPC = game.ReplicatedStorage.Knight 
local spawner = script.Parent
local Clone = NPC:Clone()
Clone.Torso.CFrame = game.Players.LocalPlayer.Character.Head.CFrame * CFrame.new(0,0,5)
 Clone.Parent = workspace
end)
game.ReplicatedStorage.RemoteEvent:FireServer()

1 comment

0

First, the FireServer should be inside the Activated listener. The Spawning itself should be done on the server (that is if you want other players and the server to see the NPC)

1 answer

✓ Accepted answer

First off, you are trying to spawn it off a local gui, meaning that it's a local script which means only you can see it.

Use a remote server, and fire it, and on the server clone the NPC and put it on the workspace, that's how i would do it.

1 comment

0

I already did this and it worked. Just gotta figure it out yourself.

This discussion is preserved as it was. New answers, comments, and votes are closed.