here is the script :
seed=script.Parent
seed.Activated:Connect(function() local i=Instance.new("Part",game.Workspace) i.BrickColor=Random i.Position = game.Players.LocalPlayer.Character.Torso.Position + Vector3.new(0,0,-5) seed:Destroy() end)
This should work, I think,
local seed=script.Parent local offset = Vector3.new(0,0,-5) local player = game.Players.LocalPlayer local Character = player.Character or player.CharacterAdded:Wait() seed.Activated:Connect(function() local i = Instance.new("Part") i.Parent = game.Workspace i.BrickColor = BrickColor.Random() i.Position = Character.HumanoidRootPart.Position + (Character.HumanoidRootPart.CFrame.lookVector * offset) seed:Destroy() end)
The reason that I don't set the parent of the new instance on line 7 is because it has been documented to cause performance issues. You can read about it here. Secondly you can't set the brick color as random. You have to use BrickColor.[Color] or set the brick color with a string.