I'm making a remake of grow a brick but on line 15 keeps having an error and when I go to clone my follow script from the workspace into the model it doesn't do it
and this is the error
18:42:44.946 - Argument 1 missing or nil 18:42:44.947 - Script 'Players.Player1.PlayerGui.BrickParent.BKG.Spawn.Click', Line 15 18:42:44.947 - Stack End 18:42:44.949 - Disconnected event because of exception
heres my script :
local player = script.Parent.Parent.Parent.Parent.Parent.Name function onClicked(GUI) if script.Parent.Spawned.Value == 1 then print'pet already spawned' elseif script.Parent.Spawned.Value == 0 then local m = Instance.new("Model", Workspace) m.Name = player.."'s Pet" local h = Instance.new("Humanoid", m) h.MaxHealth = 0 local s = Instance.new("StringValue", m) s.Name = "Owner" s.Value = player local p = Instance.new("Part", m) p.Name = "Head" p.Position = game.Workspace:findFirstChild(player.Head).Position script.Parent.Spawned.Value = 1 local f = game.Workspace.Follow:clone() f.Parent = m f.Disabled = false end end script.Parent.MouseButton1Click:connect(onClicked)
p.Position = game.Workspace:findFirstChild(player.Head).Position
FindFirstChild does not work like that, it will only accept a string as it's argument.
Change that line to:
p.Position = game.Workspace:findFirstChild(player).Head.Position
Locked by 2eggnog, OniiCh_n, TofuBytes, and Lacryma
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?