why does line 15 keep erroring out? [ANSWERED] [closed]
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 :
01 | local player = script.Parent.Parent.Parent.Parent.Parent.Name |
02 | function onClicked(GUI) |
03 | if script.Parent.Spawned.Value = = 1 then |
04 | print 'pet already spawned' |
05 | elseif script.Parent.Spawned.Value = = 0 then |
06 | local m = Instance.new( "Model" , Workspace) |
07 | m.Name = player.. "'s Pet" |
08 | local h = Instance.new( "Humanoid" , m) |
10 | local s = Instance.new( "StringValue" , m) |
13 | local p = Instance.new( "Part" , m) |
15 | p.Position = game.Workspace:findFirstChild(player.Head).Position |
16 | script.Parent.Spawned.Value = 1 |
17 | local f = game.Workspace.Follow:clone() |
22 | script.Parent.MouseButton 1 Click:connect(onClicked) |