I want to make an NPC Spawner with button. When we press the button then the npc spawns. Have a clickdetector in button but still nothing "MouseClick" is not a valid member of a part. This is an error what i get first in the output once. If i click i dont get more errors just don't spawn the NPC.
local Clicker = script.Parent --ClickDetector
local Object = game.ReplicatedStorage.Put --Put is my object in replicatedstorage
local ObjectSpawn = game.Workspace.ObjectSpawn --Object Spawner
Clicker.MouseClick:Connect(function()
local CloneObject = Object:Clone()
CloneObject.Parent = game.Workspace
CloneObject:MoveTo(ObjectSpawn.Position)
end)

1 comment
You defined Clicker wrong it is a part not a ClickDetector.